summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-16 18:23:00 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-16 18:23:00 +0000
commit805e22b2051e9c6a75377ea6599654d7415da483 (patch)
treec259697c448b0c6f548f153c48c46a8d7a75970f /gcc
parent2c27ce73ee2229b0871c4ccad2342d8a4be85eff (diff)
downloadlinaro-gcc-805e22b2051e9c6a75377ea6599654d7415da483.tar.gz
linaro-gcc-805e22b2051e9c6a75377ea6599654d7415da483.tar.bz2
linaro-gcc-805e22b2051e9c6a75377ea6599654d7415da483.zip
Merge basic-improvements-branch to trunk
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60174 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog1596
-rw-r--r--gcc/Makefile.in1096
-rw-r--r--gcc/aclocal.m478
-rw-r--r--gcc/ada/ChangeLog527
-rw-r--r--gcc/ada/Make-lang.in74
-rw-r--r--gcc/ada/cuintp.c2
-rw-r--r--gcc/ada/decl.c2
-rw-r--r--gcc/ada/deftarg.c4
-rw-r--r--gcc/ada/lang-specs.h13
-rw-r--r--gcc/ada/misc.c32
-rw-r--r--gcc/ada/targtyps.c2
-rw-r--r--gcc/ada/trans.c2
-rw-r--r--gcc/ada/utils.c2
-rw-r--r--gcc/ada/utils2.c2
-rw-r--r--gcc/alias.c2
-rw-r--r--gcc/attribs.c2
-rw-r--r--gcc/basic-block.h6
-rw-r--r--gcc/bb-reorder.c2
-rw-r--r--gcc/bitmap.c2
-rw-r--r--gcc/builtins.c188
-rw-r--r--gcc/builtins.def102
-rw-r--r--gcc/c-aux-info.c2
-rw-r--r--gcc/c-common.c20
-rw-r--r--gcc/c-convert.c2
-rw-r--r--gcc/c-decl.c2
-rw-r--r--gcc/c-dump.c2
-rw-r--r--gcc/c-errors.c2
-rw-r--r--gcc/c-format.c2
-rw-r--r--gcc/c-lang.c2
-rw-r--r--gcc/c-lex.c4
-rw-r--r--gcc/c-objc-common.c2
-rw-r--r--gcc/c-opts.c2
-rw-r--r--gcc/c-parse.in2
-rw-r--r--gcc/c-pragma.c2
-rw-r--r--gcc/c-pretty-print.c2
-rw-r--r--gcc/c-semantics.c24
-rw-r--r--gcc/c-typeck.c15
-rw-r--r--gcc/caller-save.c2
-rw-r--r--gcc/calls.c64
-rw-r--r--gcc/cfg.c2
-rw-r--r--gcc/cfganal.c2
-rw-r--r--gcc/cfgbuild.c2
-rw-r--r--gcc/cfgcleanup.c2
-rw-r--r--gcc/cfglayout.c5
-rw-r--r--gcc/cfgloop.c4
-rw-r--r--gcc/cfgrtl.c7
-rw-r--r--gcc/collect2.c70
-rw-r--r--gcc/combine.c41
-rw-r--r--gcc/config.gcc159
-rw-r--r--gcc/config.in23
-rw-r--r--gcc/config/alpha/alpha.c22
-rw-r--r--gcc/config/alpha/alpha.h32
-rw-r--r--gcc/config/alpha/alpha.md111
-rw-r--r--gcc/config/alpha/elf.h2
-rw-r--r--gcc/config/alpha/unicosmk.h4
-rw-r--r--gcc/config/alpha/vms-cc.c2
-rw-r--r--gcc/config/alpha/vms-ld.c2
-rw-r--r--gcc/config/alpha/vms.h7
-rw-r--r--gcc/config/alpha/vxworks.h55
-rw-r--r--gcc/config/alpha/xm-alpha-interix.h39
-rw-r--r--gcc/config/alpha/xm-vms.h3
-rw-r--r--gcc/config/alpha/xm-vms64.h29
-rw-r--r--gcc/config/arc/arc.c22
-rw-r--r--gcc/config/arc/arc.h18
-rw-r--r--gcc/config/arm/aof.h6
-rw-r--r--gcc/config/arm/aout.h7
-rw-r--r--gcc/config/arm/arm-protos.h1
-rw-r--r--gcc/config/arm/arm.c43
-rw-r--r--gcc/config/arm/arm.h27
-rw-r--r--gcc/config/arm/arm.md4
-rw-r--r--gcc/config/arm/elf.h20
-rw-r--r--gcc/config/arm/pe.c2
-rw-r--r--gcc/config/arm/t-pe4
-rw-r--r--gcc/config/arm/t-strongarm-pe3
-rw-r--r--gcc/config/arm/vxarm.h71
-rw-r--r--gcc/config/avr/avr.c2
-rw-r--r--gcc/config/avr/avr.h60
-rw-r--r--gcc/config/c4x/c4x-c.c2
-rw-r--r--gcc/config/c4x/c4x.c2
-rw-r--r--gcc/config/c4x/c4x.h30
-rw-r--r--gcc/config/c4x/t-c4x6
-rw-r--r--gcc/config/cris/cris.c2
-rw-r--r--gcc/config/cris/cris.h19
-rw-r--r--gcc/config/d30v/d30v.c2
-rw-r--r--gcc/config/d30v/d30v.h56
-rw-r--r--gcc/config/darwin-c.c2
-rw-r--r--gcc/config/darwin.c2
-rw-r--r--gcc/config/darwin.h7
-rw-r--r--gcc/config/dbxcoff.h2
-rw-r--r--gcc/config/dbxelf.h2
-rw-r--r--gcc/config/dsp16xx/dsp16xx-protos.h2
-rw-r--r--gcc/config/dsp16xx/dsp16xx.c4
-rw-r--r--gcc/config/dsp16xx/dsp16xx.h25
-rw-r--r--gcc/config/dsp16xx/dsp16xx.md130
-rw-r--r--gcc/config/elfos.h16
-rw-r--r--gcc/config/fp-bit.c2
-rw-r--r--gcc/config/fr30/fr30.c2
-rw-r--r--gcc/config/fr30/fr30.h27
-rw-r--r--gcc/config/frv/frv.c2
-rw-r--r--gcc/config/frv/frv.h36
-rw-r--r--gcc/config/h8300/h8300.c2
-rw-r--r--gcc/config/h8300/h8300.h21
-rw-r--r--gcc/config/h8300/h8300.md4
-rw-r--r--gcc/config/i370/i370-c.c2
-rw-r--r--gcc/config/i370/i370.c16
-rw-r--r--gcc/config/i370/i370.h47
-rw-r--r--gcc/config/i370/t-i3706
-rw-r--r--gcc/config/i386/athlon.md803
-rw-r--r--gcc/config/i386/att.h7
-rw-r--r--gcc/config/i386/bsd.h6
-rw-r--r--gcc/config/i386/freebsd-aout.h3
-rw-r--r--gcc/config/i386/i386-coff.h7
-rw-r--r--gcc/config/i386/i386-interix.h29
-rw-r--r--gcc/config/i386/i386-protos.h6
-rw-r--r--gcc/config/i386/i386.c709
-rw-r--r--gcc/config/i386/i386.h87
-rw-r--r--gcc/config/i386/i386.md1422
-rw-r--r--gcc/config/i386/k6.md2
-rw-r--r--gcc/config/i386/lynx-ng.h7
-rw-r--r--gcc/config/i386/lynx.h7
-rw-r--r--gcc/config/i386/pentium.md2
-rw-r--r--gcc/config/i386/ppro.md4
-rw-r--r--gcc/config/i386/sco5.h6
-rw-r--r--gcc/config/i386/t-cygwin4
-rw-r--r--gcc/config/i386/t-interix5
-rw-r--r--gcc/config/i386/vxi386.h66
-rw-r--r--gcc/config/i386/winnt.c2
-rw-r--r--gcc/config/i386/xm-i386-interix.h32
-rw-r--r--gcc/config/i960/i960-c.c2
-rw-r--r--gcc/config/i960/i960.c2
-rw-r--r--gcc/config/i960/i960.h19
-rw-r--r--gcc/config/i960/t-960bare6
-rw-r--r--gcc/config/i960/t-vxworks96033
-rw-r--r--gcc/config/i960/vx960-coff.h73
-rw-r--r--gcc/config/i960/vx960.h30
-rw-r--r--gcc/config/ia64/ia64-c.c2
-rw-r--r--gcc/config/ia64/ia64.c2
-rw-r--r--gcc/config/ia64/ia64.h13
-rw-r--r--gcc/config/ia64/t-ia644
-rw-r--r--gcc/config/interix.h13
-rw-r--r--gcc/config/ip2k/ip2k.c2
-rw-r--r--gcc/config/ip2k/ip2k.h24
-rw-r--r--gcc/config/m32r/m32r.c2
-rw-r--r--gcc/config/m32r/m32r.h11
-rw-r--r--gcc/config/m68hc11/m68hc11.c5
-rw-r--r--gcc/config/m68hc11/m68hc11.h10
-rw-r--r--gcc/config/m68hc11/m68hc11.md40
-rw-r--r--gcc/config/m68k/3b1.h13
-rw-r--r--gcc/config/m68k/amix.h7
-rw-r--r--gcc/config/m68k/atari.h7
-rw-r--r--gcc/config/m68k/hp320.h17
-rw-r--r--gcc/config/m68k/m68k.c53
-rw-r--r--gcc/config/m68k/m68k.h16
-rw-r--r--gcc/config/m68k/m68k.md6
-rw-r--r--gcc/config/m68k/mot3300.h18
-rw-r--r--gcc/config/m68k/netbsd-elf.h4
-rw-r--r--gcc/config/m68k/netbsd.h4
-rw-r--r--gcc/config/m68k/openbsd.h4
-rw-r--r--gcc/config/m68k/sgs.h14
-rw-r--r--gcc/config/m68k/t-vxworks6824
-rw-r--r--gcc/config/m68k/tower-as.h15
-rw-r--r--gcc/config/m68k/vxm68k.h103
-rw-r--r--gcc/config/m88k/m88k.c25
-rw-r--r--gcc/config/m88k/m88k.h37
-rw-r--r--gcc/config/mcore/mcore-pe.h2
-rw-r--r--gcc/config/mcore/mcore.c4
-rw-r--r--gcc/config/mcore/mcore.h10
-rw-r--r--gcc/config/mcore/mcore.md2
-rw-r--r--gcc/config/mips/irix6-libc-compat.c2
-rw-r--r--gcc/config/mips/linux.h6
-rw-r--r--gcc/config/mips/mips-protos.h2
-rw-r--r--gcc/config/mips/mips.c28
-rw-r--r--gcc/config/mips/mips.h28
-rw-r--r--gcc/config/mips/mips.md13
-rw-r--r--gcc/config/mips/openbsd.h4
-rw-r--r--gcc/config/mips/vr.h2
-rw-r--r--gcc/config/mips/vxworks.h29
-rw-r--r--gcc/config/mmix/mmix-protos.h2
-rw-r--r--gcc/config/mmix/mmix.c13
-rw-r--r--gcc/config/mmix/mmix.h7
-rw-r--r--gcc/config/mn10200/mn10200.c2
-rw-r--r--gcc/config/mn10200/mn10200.h8
-rw-r--r--gcc/config/mn10300/mn10300.c4
-rw-r--r--gcc/config/mn10300/mn10300.h8
-rw-r--r--gcc/config/netbsd-aout.h4
-rw-r--r--gcc/config/ns32k/ns32k.c2
-rw-r--r--gcc/config/ns32k/ns32k.h20
-rw-r--r--gcc/config/ns32k/ns32k.md2
-rw-r--r--gcc/config/openbsd.h12
-rw-r--r--gcc/config/pa/pa-linux.h7
-rw-r--r--gcc/config/pa/pa.c62
-rw-r--r--gcc/config/pa/pa.h45
-rw-r--r--gcc/config/pa/pa.md10
-rw-r--r--gcc/config/pa/pa64-hpux.h4
-rw-r--r--gcc/config/pdp11/pdp11.c2
-rw-r--r--gcc/config/pdp11/pdp11.h16
-rw-r--r--gcc/config/ptx4.h11
-rw-r--r--gcc/config/romp/romp.c2
-rw-r--r--gcc/config/romp/romp.h24
-rw-r--r--gcc/config/rs6000/linux64.h2
-rw-r--r--gcc/config/rs6000/lynx.h1
-rw-r--r--gcc/config/rs6000/rs6000-c.c2
-rw-r--r--gcc/config/rs6000/rs6000.c34
-rw-r--r--gcc/config/rs6000/rs6000.h16
-rw-r--r--gcc/config/rs6000/rs6000.md53
-rw-r--r--gcc/config/rs6000/sysv4.h229
-rw-r--r--gcc/config/rs6000/t-rs6000-c-rule5
-rw-r--r--gcc/config/rs6000/t-vxworks10
-rw-r--r--gcc/config/rs6000/vxppc.h57
-rw-r--r--gcc/config/rs6000/vxworks.h81
-rw-r--r--gcc/config/rs6000/xcoff.h10
-rw-r--r--gcc/config/s390/s390.c31
-rw-r--r--gcc/config/s390/s390.h7
-rw-r--r--gcc/config/s390/s390.md2
-rw-r--r--gcc/config/sh/coff.h4
-rw-r--r--gcc/config/sh/elf.h4
-rw-r--r--gcc/config/sh/lib1funcs.asm191
-rw-r--r--gcc/config/sh/libgcc-glibc.ver21
-rw-r--r--gcc/config/sh/linux.h195
-rw-r--r--gcc/config/sh/sh-protos.h1
-rw-r--r--gcc/config/sh/sh.c142
-rw-r--r--gcc/config/sh/sh.h27
-rw-r--r--gcc/config/sh/sh.md43
-rw-r--r--gcc/config/sh/t-linux6
-rw-r--r--gcc/config/sparc/freebsd.h8
-rw-r--r--gcc/config/sparc/gmon-sol2.c6
-rw-r--r--gcc/config/sparc/linux.h7
-rw-r--r--gcc/config/sparc/linux64.h7
-rw-r--r--gcc/config/sparc/netbsd-elf.h7
-rw-r--r--gcc/config/sparc/pbd.h9
-rw-r--r--gcc/config/sparc/sol2.h7
-rw-r--r--gcc/config/sparc/sparc.c38
-rw-r--r--gcc/config/sparc/sparc.h45
-rw-r--r--gcc/config/sparc/sysv4.h2
-rw-r--r--gcc/config/sparc/t-sol23
-rw-r--r--gcc/config/sparc/t-vxsparc10
-rw-r--r--gcc/config/sparc/t-vxsparc6423
-rw-r--r--gcc/config/sparc/vxsim.h136
-rw-r--r--gcc/config/sparc/vxsparc.h59
-rw-r--r--gcc/config/sparc/vxsparc64.h92
-rw-r--r--gcc/config/stormy16/stormy16.c2
-rw-r--r--gcc/config/stormy16/stormy16.h47
-rw-r--r--gcc/config/svr3.h10
-rw-r--r--gcc/config/svr4.h14
-rw-r--r--gcc/config/t-darwin16
-rw-r--r--gcc/config/t-libunwind1
-rw-r--r--gcc/config/t-vxworks25
-rw-r--r--gcc/config/v850/t-v8506
-rw-r--r--gcc/config/v850/v850-c.c2
-rw-r--r--gcc/config/v850/v850.c2
-rw-r--r--gcc/config/v850/v850.h8
-rw-r--r--gcc/config/vax/vax-protos.h3
-rw-r--r--gcc/config/vax/vax.c290
-rw-r--r--gcc/config/vax/vax.h16
-rw-r--r--gcc/config/vax/vms.h274
-rw-r--r--gcc/config/vax/xm-vms.h174
-rw-r--r--gcc/config/vxlib.c325
-rw-r--r--gcc/config/vxworks.h65
-rw-r--r--gcc/config/xtensa/xtensa.c2
-rw-r--r--gcc/config/xtensa/xtensa.h14
-rwxr-xr-xgcc/configure988
-rw-r--r--gcc/configure.in105
-rw-r--r--gcc/conflict.c2
-rw-r--r--gcc/convert.c161
-rw-r--r--gcc/coretypes.h59
-rw-r--r--gcc/cp/ChangeLog91
-rw-r--r--gcc/cp/Make-lang.in62
-rw-r--r--gcc/cp/call.c2
-rw-r--r--gcc/cp/class.c94
-rw-r--r--gcc/cp/cp-lang.c2
-rw-r--r--gcc/cp/cp-tree.h112
-rw-r--r--gcc/cp/cvt.c2
-rw-r--r--gcc/cp/cxxfilt.c304
-rw-r--r--gcc/cp/decl.c16
-rw-r--r--gcc/cp/decl2.c39
-rw-r--r--gcc/cp/dump.c21
-rw-r--r--gcc/cp/error.c2
-rw-r--r--gcc/cp/except.c2
-rw-r--r--gcc/cp/expr.c2
-rw-r--r--gcc/cp/friend.c2
-rw-r--r--gcc/cp/g++spec.c2
-rw-r--r--gcc/cp/init.c41
-rw-r--r--gcc/cp/lex.c2
-rw-r--r--gcc/cp/mangle.c87
-rw-r--r--gcc/cp/method.c319
-rw-r--r--gcc/cp/optimize.c39
-rw-r--r--gcc/cp/parse.y2
-rw-r--r--gcc/cp/pt.c2
-rw-r--r--gcc/cp/ptree.c2
-rw-r--r--gcc/cp/repo.c2
-rw-r--r--gcc/cp/rtti.c46
-rw-r--r--gcc/cp/search.c141
-rw-r--r--gcc/cp/semantics.c75
-rw-r--r--gcc/cp/spew.c9
-rw-r--r--gcc/cp/tree.c56
-rw-r--r--gcc/cp/typeck.c2
-rw-r--r--gcc/cp/typeck2.c2
-rw-r--r--gcc/cppdefault.c2
-rw-r--r--gcc/cpperror.c2
-rw-r--r--gcc/cppexp.c2
-rw-r--r--gcc/cppfiles.c2
-rw-r--r--gcc/cpphash.c2
-rw-r--r--gcc/cppinit.c68
-rw-r--r--gcc/cpplex.c4
-rw-r--r--gcc/cpplib.c9
-rw-r--r--gcc/cpplib.h11
-rw-r--r--gcc/cppmacro.c28
-rw-r--r--gcc/cppmain.c2
-rw-r--r--gcc/cppspec.c2
-rw-r--r--gcc/cpptrad.c8
-rw-r--r--gcc/crtstuff.c2
-rw-r--r--gcc/cse.c128
-rw-r--r--gcc/cselib.c2
-rw-r--r--gcc/dbxout.c12
-rw-r--r--gcc/debug.c2
-rw-r--r--gcc/defaults.h34
-rw-r--r--gcc/df.c4
-rw-r--r--gcc/diagnostic.c2
-rw-r--r--gcc/doc/configfiles.texi4
-rw-r--r--gcc/doc/extend.texi56
-rw-r--r--gcc/doc/gcov.texi121
-rw-r--r--gcc/doc/install-old.texi2
-rw-r--r--gcc/doc/install.texi59
-rw-r--r--gcc/doc/invoke.texi130
-rw-r--r--gcc/doc/md.texi45
-rw-r--r--gcc/doc/tm.texi70
-rw-r--r--gcc/doloop.c2
-rw-r--r--gcc/dominance.c2
-rw-r--r--gcc/dummy-conditions.c4
-rw-r--r--gcc/dwarf2asm.c5
-rw-r--r--gcc/dwarf2out.c71
-rw-r--r--gcc/dwarfout.c6
-rw-r--r--gcc/emit-rtl.c2
-rw-r--r--gcc/errors.c2
-rw-r--r--gcc/et-forest.c2
-rw-r--r--gcc/except.c8
-rw-r--r--gcc/explow.c5
-rw-r--r--gcc/expmed.c2
-rw-r--r--gcc/expr.c36
-rw-r--r--gcc/f/ChangeLog22
-rw-r--r--gcc/f/Make-lang.in107
-rw-r--r--gcc/f/ansify.c4
-rw-r--r--gcc/f/fini.c2
-rw-r--r--gcc/f/g77spec.c2
-rw-r--r--gcc/f/intdoc.c4
-rw-r--r--gcc/f/lang-specs.h6
-rw-r--r--gcc/f/proj.h6
-rw-r--r--gcc/f/target.h4
-rw-r--r--gcc/final.c313
-rw-r--r--gcc/fix-header.c4
-rw-r--r--gcc/fixinc/fixlib.h4
-rw-r--r--gcc/fixinc/procopen.c5
-rw-r--r--gcc/fixinc/server.c10
-rw-r--r--gcc/fixinc/server.h7
-rw-r--r--gcc/flow.c2
-rw-r--r--gcc/fold-const.c80
-rw-r--r--gcc/function.c77
-rw-r--r--gcc/function.h2
-rw-r--r--gcc/gcc.c964
-rw-r--r--gcc/gccspec.c2
-rw-r--r--gcc/gcov-dump.c462
-rw-r--r--gcc/gcov-io.h622
-rw-r--r--gcc/gcov-iov.c70
-rw-r--r--gcc/gcov.c2035
-rw-r--r--gcc/gcse.c8
-rw-r--r--gcc/gen-protos.c4
-rw-r--r--gcc/genattr.c4
-rw-r--r--gcc/genattrtab.c9
-rw-r--r--gcc/genautomata.c11
-rw-r--r--gcc/gencheck.c4
-rw-r--r--gcc/gencodes.c4
-rw-r--r--gcc/genconditions.c8
-rw-r--r--gcc/genconfig.c4
-rw-r--r--gcc/genconstants.c4
-rw-r--r--gcc/genemit.c6
-rw-r--r--gcc/genextract.c6
-rw-r--r--gcc/genflags.c4
-rw-r--r--gcc/gengenrtl.c6
-rw-r--r--gcc/gengtype-lex.l4
-rw-r--r--gcc/gengtype-yacc.y4
-rw-r--r--gcc/gengtype.c16
-rw-r--r--gcc/genopinit.c11
-rw-r--r--gcc/genoutput.c7
-rw-r--r--gcc/genpeep.c6
-rw-r--r--gcc/genpreds.c4
-rw-r--r--gcc/genrecog.c6
-rw-r--r--gcc/gensupport.c4
-rw-r--r--gcc/ggc-common.c2
-rw-r--r--gcc/ggc-none.c2
-rw-r--r--gcc/ggc-page.c2
-rw-r--r--gcc/ggc-simple.c2
-rw-r--r--gcc/global.c12
-rw-r--r--gcc/graph.c2
-rw-r--r--gcc/gthr-dce.h7
-rw-r--r--gcc/gthr-posix.h10
-rw-r--r--gcc/gthr-rtems.h7
-rw-r--r--gcc/gthr-solaris.h7
-rw-r--r--gcc/gthr-vxworks.h285
-rw-r--r--gcc/gthr-win32.h16
-rw-r--r--gcc/gthr.h2
-rw-r--r--gcc/haifa-sched.c4
-rw-r--r--gcc/hashtable.c2
-rw-r--r--gcc/hashtable.h2
-rw-r--r--gcc/hooks.c10
-rw-r--r--gcc/hooks.h2
-rw-r--r--gcc/hwint.h211
-rw-r--r--gcc/ifcvt.c2
-rw-r--r--gcc/integrate.c2
-rw-r--r--gcc/intl.c2
-rw-r--r--gcc/java/ChangeLog19
-rw-r--r--gcc/java/Make-lang.in95
-rw-r--r--gcc/java/boehm.c2
-rw-r--r--gcc/java/buffer.c2
-rw-r--r--gcc/java/builtins.c2
-rw-r--r--gcc/java/check-init.c2
-rw-r--r--gcc/java/class.c2
-rw-r--r--gcc/java/constants.c2
-rw-r--r--gcc/java/decl.c2
-rw-r--r--gcc/java/except.c2
-rw-r--r--gcc/java/expr.c2
-rw-r--r--gcc/java/gjavah.c2
-rw-r--r--gcc/java/jcf-depend.c2
-rw-r--r--gcc/java/jcf-dump.c2
-rw-r--r--gcc/java/jcf-io.c2
-rw-r--r--gcc/java/jcf-parse.c2
-rw-r--r--gcc/java/jcf-path.c2
-rw-r--r--gcc/java/jcf-write.c2
-rw-r--r--gcc/java/jv-scan.c2
-rw-r--r--gcc/java/jvgenmain.c2
-rw-r--r--gcc/java/jvspec.c41
-rw-r--r--gcc/java/lang.c2
-rw-r--r--gcc/java/mangle.c2
-rw-r--r--gcc/java/mangle_name.c2
-rw-r--r--gcc/java/parse-scan.y2
-rw-r--r--gcc/java/parse.y10
-rw-r--r--gcc/java/typeck.c2
-rw-r--r--gcc/java/verify.c2
-rw-r--r--gcc/java/xref.c2
-rw-r--r--gcc/java/zextract.c2
-rw-r--r--gcc/jump.c47
-rw-r--r--gcc/langhooks-def.h2
-rw-r--r--gcc/langhooks.c12
-rw-r--r--gcc/langhooks.h2
-rw-r--r--gcc/lcm.c2
-rw-r--r--gcc/libgcc2.c596
-rw-r--r--gcc/libgcc2.h13
-rw-r--r--gcc/line-map.c2
-rw-r--r--gcc/lists.c2
-rw-r--r--gcc/local-alloc.c2
-rw-r--r--gcc/loop.c44
-rw-r--r--gcc/machmode.def5
-rw-r--r--gcc/main.c2
-rw-r--r--gcc/mbchar.c2
-rw-r--r--gcc/mips-tdump.c2
-rw-r--r--gcc/mips-tfile.c2
-rw-r--r--gcc/mkconfig.sh105
-rw-r--r--gcc/mkdeps.c2
-rw-r--r--gcc/mklibgcc.in4
-rw-r--r--gcc/objc/Make-lang.in43
-rw-r--r--gcc/objc/objc-act.c2
-rw-r--r--gcc/objc/objc-lang.c2
-rw-r--r--gcc/optabs.c73
-rw-r--r--gcc/optabs.h11
-rw-r--r--gcc/output.h12
-rw-r--r--gcc/params.c2
-rw-r--r--gcc/predict.c4
-rw-r--r--gcc/prefix.c2
-rw-r--r--gcc/print-rtl.c2
-rw-r--r--gcc/print-tree.c2
-rw-r--r--gcc/profile.c1154
-rw-r--r--gcc/profile.h2
-rw-r--r--gcc/protoize.c2
-rw-r--r--gcc/ra-build.c2
-rw-r--r--gcc/ra-colorize.c6
-rw-r--r--gcc/ra-debug.c2
-rw-r--r--gcc/ra-rewrite.c2
-rw-r--r--gcc/ra.c2
-rw-r--r--gcc/read-rtl.c4
-rw-r--r--gcc/real.c100
-rw-r--r--gcc/real.h7
-rw-r--r--gcc/recog.c2
-rw-r--r--gcc/reg-stack.c2
-rw-r--r--gcc/regclass.c2
-rw-r--r--gcc/regmove.c2
-rw-r--r--gcc/regrename.c4
-rw-r--r--gcc/reload.c8
-rw-r--r--gcc/reload1.c16
-rw-r--r--gcc/reorg.c2
-rw-r--r--gcc/resource.c2
-rw-r--r--gcc/rtl-error.c2
-rw-r--r--gcc/rtl.c2
-rw-r--r--gcc/rtl.h36
-rw-r--r--gcc/rtlanal.c108
-rw-r--r--gcc/sbitmap.c2
-rw-r--r--gcc/scan-decls.c4
-rw-r--r--gcc/scan.c4
-rw-r--r--gcc/sched-deps.c2
-rw-r--r--gcc/sched-ebb.c2
-rw-r--r--gcc/sched-rgn.c4
-rw-r--r--gcc/sched-vis.c2
-rw-r--r--gcc/sdbout.c3
-rw-r--r--gcc/sibcall.c2
-rw-r--r--gcc/simplify-rtx.c66
-rw-r--r--gcc/ssa-ccp.c2
-rw-r--r--gcc/ssa-dce.c2
-rw-r--r--gcc/ssa.c2
-rw-r--r--gcc/stmt.c114
-rw-r--r--gcc/stor-layout.c128
-rw-r--r--gcc/stringpool.c2
-rw-r--r--gcc/system.h15
-rw-r--r--gcc/target-def.h11
-rw-r--r--gcc/target.h9
-rw-r--r--gcc/testsuite/ChangeLog41
-rw-r--r--gcc/testsuite/g++.dg/inherit/covariant1.C10
-rw-r--r--gcc/testsuite/g++.dg/inherit/covariant2.C70
-rw-r--r--gcc/testsuite/g++.dg/inherit/covariant3.C70
-rw-r--r--gcc/testsuite/g++.dg/inherit/covariant4.C76
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb17.C2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/shiftopt-1.c73
-rw-r--r--gcc/testsuite/gcc.dg/bf-ms-layout.c232
-rw-r--r--gcc/testsuite/gcc.dg/bf-no-ms-layout.c232
-rw-r--r--gcc/testsuite/gcc.dg/builtins-2.c146
-rw-r--r--gcc/testsuite/gcc.dg/builtins-3.c55
-rw-r--r--gcc/testsuite/gcc.dg/i386-bitfield1.c1
-rw-r--r--gcc/testsuite/gcc.dg/i386-cmov1.c29
-rw-r--r--gcc/testsuite/gcc.dg/i386-cmov2.c9
-rw-r--r--gcc/testsuite/gcc.dg/i386-cmov3.c9
-rw-r--r--gcc/testsuite/gcc.dg/i386-ssefp-1.c15
-rw-r--r--gcc/testsuite/gcc.dg/i386-ssefp-2.c15
-rw-r--r--gcc/testsuite/gcc.dg/sibcall-5.c41
-rw-r--r--gcc/testsuite/gcc.dg/sibcall-6.c42
-rw-r--r--gcc/timevar.c12
-rw-r--r--gcc/timevar.h6
-rw-r--r--gcc/tlink.c2
-rw-r--r--gcc/toplev.c17
-rw-r--r--gcc/tracer.c2
-rw-r--r--gcc/tree-dump.c2
-rw-r--r--gcc/tree-inline.c43
-rw-r--r--gcc/tree.c175
-rw-r--r--gcc/tree.h41
-rw-r--r--gcc/treelang/ChangeLog30
-rw-r--r--gcc/treelang/Make-lang.in30
-rw-r--r--gcc/treelang/lex.l17
-rw-r--r--gcc/treelang/parse.y14
-rw-r--r--gcc/treelang/tree1.c11
-rw-r--r--gcc/treelang/treetree.c17
-rw-r--r--gcc/unroll.c2
-rw-r--r--gcc/unwind-dw2-fde-glibc.c6
-rw-r--r--gcc/unwind-dw2-fde.c2
-rw-r--r--gcc/unwind-dw2.c2
-rw-r--r--gcc/unwind-libunwind.c157
-rw-r--r--gcc/unwind-sjlj.c10
-rw-r--r--gcc/varasm.c65
-rw-r--r--gcc/varray.c2
-rw-r--r--gcc/varray.h2
-rw-r--r--gcc/version.c2
-rw-r--r--gcc/vmsdbgout.c13
-rw-r--r--gcc/xcoffout.c2
558 files changed, 16259 insertions, 10558 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7d05e4e7bf7..a94df384d1a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -4,6 +4,95 @@ Mon Dec 16 17:20:04 2002 J"orn Rennecke <joern.rennecke@superh.com>
(EXTRA_CONSTRAINT): Use it.
* sh.md (anddi3): Use 'Z' constraint for alternative 2.
+2002-12-15 Zack Weinberg <zack@codesourcery.com>
+
+ * config.gcc (need_64bit_hwint): New variable.
+ (alpha*-*-*, x86_64-*-*, ia64-*-*, mips*-*-*, powerpc*-*-*,
+ mmix-knuth-mmixware, rs6000*-*-*, sparc64*-*-*, s390*-*-*,
+ sh*-*-*, hppa*64*-*-linux, parisc*64*-*-linux, hppa*64*-*-hpux11*,
+ sparcv9-*-solaris2*, sparc*-*-solaris2.[789], ultrasparc-*-freebsd*):
+ Set it.
+ (powerpc*-*-darwin*): Unset it.
+ (alpha-*-interix, alpha64-dec-*vms*, i?86-*-interix3*,
+ i?86-*-interix*, sparc64-*-openbsd*): Remove references to
+ deleted/nonexistent xm-*.h headers.
+ * configure.in: AC_DEFINE NEED_64BIT_HOST_WIDE_INT if the
+ target set need_64bit_hwint in config.gcc.
+ * configure, config.in: Regenerate.
+
+ * hwint.h: Overhaul. Don't bother trying int for
+ HOST_WIDE_INT. Do try __int64 if long is not enough. Base
+ decision to force 64-bit HOST_WIDE_INT on
+ NEED_64BIT_HOST_WIDE_INT, not (MAX_)LONG_TYPE_SIZE which is
+ not visible at this point. Don't allow prior definition of
+ any macro defined by this file.
+
+ * config/alpha/xm-vms.h: Don't define HOST_WIDE_INT or
+ HOST_BITS_PER_WIDE_INT.
+ * config/c4x/c4x.h: Adjust redefinition of
+ HOST_WIDE_INT_PRINT_HEX to match changes to hwint.h.
+ * config/alpha/xm-alpha-interix.h, config/alpha/xm-vms64.h,
+ config/i386/xm-i386-interix.h: Delete file.
+
+2002-12-14 Rodney Brown <rbrown64@csc.com.au>
+ John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * pa.c (output_millicode_call): Convert ASM_OUTPUT_INTERNAL_LABEL.
+ * pa64-hpux.h (ASM_OUTPUT_INTERNAL_LABEL): Delete define.
+
+2002-12-14 Zack Weinberg <zack@codesourcery.com>
+
+ * mkconfig.sh: Correct comment. Add copyright boilerplate.
+
+2002-12-14 Zack Weinberg <zack@codesourcery.com>
+
+ * config/t-darwin, config/arm/t-pe, config/arm/t-strongarm-pe,
+ config/c4x/t-c4x, config/i370/t-i370, config/i386/t-cygwin,
+ config/i386/t-interix, config/i960/t-960bare, config/ia64/t-ia64,
+ config/rs6000/t-rs6000-c-rule, config/sparc/t-sol2,
+ config/v850/t-v850: Correct dependencies and normalize
+ compilation commands for files that include coretypes.h and tm.h.
+
+ * config/sparc/gmon-sol2.c: Include tconfig.h and tsystem.h,
+ not config.h and system.h.
+
+Sat Dec 14 20:43:41 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (flags_reg_operand): New function.
+ * i386.h (PREDICATE_CODES): Add flags_reg_operand.
+ * i386.md (cmov splitter, movqicc): Use new predicate.
+
+Sat Dec 14 17:03:17 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (movqicc splitter): Fix template.
+
+2002-12-13 Jason Merrill <jason@redhat.com>
+
+ * tree.h (CALL_EXPR_HAS_RETURN_SLOT_ADDR): New macro.
+ * calls.c (expand_call): Handle it.
+ * tree-inline.c (struct inline_data): Remove target_exprs field.
+ (optimize_inline_calls): Don't initialize it.
+ (expand_call_inline): Don't modify it. Handle
+ CALL_EXPR_HAS_RETURN_SLOT_ADDR.
+ (declare_return_variable): Take return slot addr.
+ * langhooks.h (copy_res_decl_for_inlining): Change target_exprs parm
+ to return_slot_addr.
+ * langhooks-def.h, langhooks.c: Adjust.
+ * explow.c (maybe_set_unchanging): Don't set RTX_UNCHANGING_P for
+ a decl with no DECL_INITIAL.
+
+ * expr.c (expand_expr): Don't discard the target of a call which
+ returns in memory.
+
+2002-12-13 Neil Booth <neil@daikokuya.co.uk>
+
+ * cppinit.c (path_include): Take an environment variable name.
+ Tidy up.
+ (init_standard_includes): Simplify environment handling, and
+ move to ...
+ (cpp_read_main_file): ...here as -nostdinc should not affect
+ environment variable paths.
+
2002-12-13 John David Anglin <dave@hiauly1.hia.nrc.ca>
* pa.c (output_millicode_call): Correct typo.
@@ -42,6 +131,11 @@ Fri Dec 13 16:02:27 2002 J"orn Rennecke <joern.rennecke@superh.com>
* config/h8300/h8300.md (addhi3_h8300): Remove the last
alternative.
+2002-12-12 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * hooks.h (hook_tree_tree_bool_false): Declare
+ hook_bool_tree_tree_false instead.
+
2002-12-12 Devang Patel <dpatel@apple.com>
* doc/invoke.texi: Document Darwin linker options, -bundle
@@ -134,6 +228,19 @@ Thu Dec 12 16:24:59 2002 J"orn Rennecke <joern.rennecke@superh.com>
("jump"): Support PIC-safe out-of-range-for-branch jumps. Remove
unused code to support indirect jumps.
+2002-12-11 Zack Weinberg <zack@codesourcery.com>
+
+ * Makefile.in (GTFILES): Add $(host_xm_file_list) and
+ $(tm_file_list).
+
+2002-12-11 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/t-rs6000-c-rule: Add coretypes.h $(TM_H) dependencies.
+
+Wed Dec 11 15:20:45 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (cmove splitters): Avoid creation of unnecesary subregs.
+
2002-12-11 John David Anglin <dave@hiauly1.hia.nrc.ca>
* pa.h (BIGGEST_ALIGNMENT): Change 32-bit value to 64 bits.
@@ -193,6 +300,27 @@ Wed Dec 11 18:39:52 2002 J"orn Rennecke <joern.rennecke@superh.com>
* c-common.c (builtin_define_type_max): Handle unsigned
types too.
+2002-12-10 David Edelsohn <edelsohn@gnu.org>
+
+ * haifa-sched.c (rank_for_schedule): Correct style.
+
+2002-12-10 Per Bothner <pbothner@apple.com>
+
+ * cpplib.h (struct cpp_hashnode): Split a non-portably-signed field
+ directive_index into an unsigned field and a new is_directive field.
+ * cppinit.c (mark_named_operators): Update to set new fields.
+ * cpplex.c (_cpp_lex_direct): Now directive_field is unsigned.
+ * cpplib.c [_cpp_handle_directive]: Test is_directive field.
+ No longer need to subtract 1 from directive_index.
+ (_cpp_init_directives): No longer need to add 1 to directive_index.
+ * cpptrad.c (scan_out_logical_line): Use is_directive field.
+
+2002-12-10 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (fold_builtin): Remove -funsafe-math-optimizations
+ check for evaluating sqrt of a constant at compile time.
+ * simplify-rtx.c (simplify_unary_operation): Likewise.
+
2002-12-10 Janis Johnson <janis187@us.ibm.com>
PR other/8882
@@ -202,7 +330,7 @@ Wed Dec 11 18:39:52 2002 J"orn Rennecke <joern.rennecke@superh.com>
* config/darwin.h(LINK_SPEC): Add darwin specific linker options.
* doc/invoke.texi: Add new "Darwin Options" section.
-
+
2002-12-10 Jim Wilson <wilson@redhat.com>
* rs6000.h (RETURN_IN_MEMORY): If ABI_V4, then TFmode is returned in
@@ -279,7 +407,7 @@ Mon Dec 9 21:33:38 CET 2002 Jan Hubicka <jh@suse.cz>
* stmt.c (expand_return): Ditto.
* expr.c (move_block_from_reg): Ditto.
(copy_blkmode_from_reg): Ditto.
- * expmed.c (store_bit_field): Ditto.
+ * expmed.c (store_bit_field): Ditto.
2002-12-09 Svein E. Seldal <Svein.Seldal@solidas.com>
@@ -290,6 +418,40 @@ Sun Dec 8 14:57:39 CET 2002 Jan Hubicka <jh@suse.cz>
* i386.c (ix86_expand_int_movcc): Use force_operand instead of
constructing insn directly.
+2002-12-06 Per Bothner <pbothner@apple.com>
+
+ * cpplib.h (struct cpp_hashnode): Change field directive_index from
+ char to an int bit-field, for hosts where char is unsigned.
+
+2002-12-07 Roger Sayle <roger@eyesopen.com>
+ Richard Henderson <rth@redhat.com>
+
+ * real.c (ieee_extended_motorola_format,
+ ieee_extended_intel_96_format, ieee_extended_intel_128_format,
+ ieee_quad_format, vax_d_format, vax_g_format, i370_double_format):
+ Provide appropriate values for new signbit field.
+
+2002-12-07 Roger Sayle <roger@eyesopen.com>
+
+ * real.h (real_format): Add signbit field.
+ * real.c (ieee_single_format, ieee_double_format,
+ ieee_extended_motorola_format, ieee_extended_intel_96_format,
+ ieee_extended_intel_128_format, ibm_extended_format,
+ ieee_quad_format, vax_f_format, vax_d_format,
+ vax_g_format, i370_single_format, i370_double_format,
+ c4x_single_format, c4x_extended_format, real_internal_format):
+ Provide suitable signbit value, or -1 to avoid bit twiddling.
+
+ * optabs.c (expand_unop): Try implementing negation of
+ floating point modes by flipping the sign bit.
+ (expand_abs): Try implementing abs of floating point modes
+ by clearing the sign bit.
+
+Sat Dec 7 22:29:47 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_expand_int_movcc): Use force_operand instead
+ of constructing insn directly.
+
2002-12-07 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.md (*iorhi_shift_8): New.
@@ -304,6 +466,26 @@ Sun Dec 8 14:57:39 CET 2002 Jan Hubicka <jh@suse.cz>
* doc/install.texi (Configuration): Improve description of cases
where `make distclean` may fail; clarify --with-gnu-as; fix grammar.
+2002-12-06 Per Bothner <pbothner@apple.com>
+
+ * cpplib.h (NODE_MACRO_ARG): New flag.
+ (struct cpp_hashnode): Give _cpp_hashnode_value tag to value union.
+ Remove value.operator field. Move arg_index field to value union.
+ (directive_index): Make signed, since also used for C++ operators.
+ * cppmacro.c (_cpp_save_parameter): Use NODE_MACRO_ARG flag to
+ check for duplicate parameter. Set NODE_MACRO_ARG flag.
+ Save node->value, and set node->value.arg_index.
+ (_cpp_create_definition): For each paramater, restore node->value.
+ (lex_expansion_token): Use NODE_MACRO_ARG flag, and moved arg_index.
+ * cpptrad.c (scan_out_logical_line): Likewise.
+ (scan_out_logical_line): Check for directive > 0.
+ * cpplib.c (cpp_handle_directive): Likewise.
+ * cpplex.c (_cpp_lex_direct): Update as value.operator is replaced
+ by negative of directive_index.
+ * cppinit.c (mark_named_operators): Likewise.
+
+ * hashtable.h (struct ht_identifier): Swap fields, for better packing.
+
2002-12-06 Dhananjay Deshpande <dhananjayd@kpit.com>
* gcc/config/sh/sh.c (calc_live_regs): Save fpscr only if target has
@@ -332,6 +514,26 @@ Fri Dec 6 15:44:46 2002 J"orn Rennecke <joern.rennecke@superh.com>
* expr.c (expand_expr) <case COND_EXPR>: Never modify exp in place.
+Thu Dec 5 16:58:25 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (dimode peep2s): Re-add "&& 1".
+
+Thu Dec 5 14:10:15 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_expand_prologue): Add comment, do not use
+ fast prologues for cold and normal functions.
+
+Thu Dec 5 00:52:37 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (x86_rep_movl_optimal): New variable.
+ (ix86_expand_movstr, ix86_expand_clrstr): Use TARGET_REP_MOVL_OPTIMAL
+ * i386.h (TARGET_REP_MOVL_OPTIMAL): New macro.
+
+ * i386.md (negsf2_ifs, negdf2_ifs, negdf2_ifs_rex64, abssf2_ifs,
+ absdf2_ifs, absdf2_ifs_rex64): Fix constraints.
+ neg?f2_ifs, abs?f2_ifs splitters): Refuse memory operand; do not
+ generate unnecesary subregs.
+
2002-12-05 John David Anglin <dave@hiauly1.hia.nrc.ca>
* pa32-linux.h (CANONICALIZE_FUNCPTR_FOR_COMPARE_LIBCALL): Move define.
@@ -367,6 +569,11 @@ Fri Dec 6 15:44:46 2002 J"orn Rennecke <joern.rennecke@superh.com>
(get_shift_alg): Return optimal assembly instructions for the
shifts mentioned above.
+Wed Dec 4 11:53:07 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_expand_int_movcc): Force operand into register for QImode
+ condtiional moves.
+
2002-12-04 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.c (h8300_init_once): Do not use loop to
@@ -435,7 +642,7 @@ Wed Dec 4 15:20:54 CET 2002 Jan Hubicka <jh@suse.cz>
2002-12-03 Aldy Hernandez <aldyh@redhat.com>
- * config/rs6000/spe.md (*movv1di_const0): New pattern.
+ * config/rs6000/spe.md (*movv1di_const0): New pattern.
2002-12-03 Richard Henderson <rth@redhat.com>
@@ -463,6 +670,33 @@ Wed Dec 4 15:20:54 CET 2002 Jan Hubicka <jh@suse.cz>
* config/h8300/h8300.c (single_one_operand): Fix a warning.
(single_zero_operand): Likewise.
+2002-12-02 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * Makefile.in configure configure.in dummy-conditions.c fix-header.c
+ gcov-iov.c gen-protos.c genattr.c genattrtab.c genautomata.c
+ gencheck.c gencodes.c genconditions.c genconfig.c genconstants.c
+ genemit.c genextract.c genflags.c gengenrtl.c gengtype-lex.l
+ gengtype-yacc.y gengtype.c genopinit.c genoutput.c genpeep.c
+ genpreds.c genrecog.c gensupport.c mkconfig.sh read-rtl.c
+ scan-decls.c scan.c config/sh/sh.h doc/configfiles.texi
+ doc/install-old.texi: Replace hconfig.h with bconfig.h.
+ * Makefile.in: Replace HCONFIG_H with BCONFIG_H.
+
+2002-12-02 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * config/rs6000/rs6000.md (ffssi): Convert to expander.
+ (ffsdi): Likewise.
+ (cntlzw2, cntlzd2): New patterns.
+
+2002-12-02 H.J. Lu <hjl@gnu.org>
+
+ * config.gcc (mips*-*-netbsd*): Remove mips/t-netbsd.
+ (mips*-*-linux*): Remove mips/t-linux.
+
+Mon Dec 2 19:26:30 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_expand_int_movcc): Avoid overflow.
+
2002-12-02 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.c (dosize): Replace argument op with
@@ -512,6 +746,11 @@ Mon Dec 2 14:43:22 2002 J"orn Rennecke <joern.rennecke@superh.com>
* ra-build.c: Fix a comment typo.
+Sun Dec 1 16:50:47 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_expand_int_movcc): fix
+ reversed BRANCH_COST test; be curefull about infinite recursion.
+
2002-12-01 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.c (h8300_output_function_prologue):
@@ -540,12 +779,131 @@ Mon Dec 2 14:43:22 2002 J"orn Rennecke <joern.rennecke@superh.com>
* c-format.c (T_ST): Use size_type_node, not c_size_type_node.
* tree.h (TI_SIZE_TYPE): New enumeral.
(size_type_node): Likewise.
-
+
+2002-11-30 Zack Weinberg <zack@codesourcery.com>
+
+ * configure.in: Don't put ${tm_file} into host_xm_file,
+ build_xm_file, or xm_file. Do put tm-preds.h into tm_p_file.
+ Take location of tm-preds.h into account when calculating
+ tm_p_file_list.
+ * configure: Regenerate.
+ * mkconfig.sh: No need for separate TM_DEFINES and XM_DEFINES
+ arguments. Do not provide rtx, rtvec, tree, or GTY here.
+ Remove special case code for tm_p.h and *config.h; add new
+ special case code for tm.h and tconfig.h. Clean up a bit.
+
+ * Makefile.in (tm_file, tm_file_list): New variables set from
+ @-substitutions.
+ (GCONFIG_H): Deleted.
+ (GTM_H, TM_H): New.
+ (CONFIG_H): Is now just config.h $(host_xm_file_list).
+ (TM_P_H): Move up with the other mkconfig.sh-generated
+ headers; don't mention tm-preds.h explicitly.
+ (tm.h, cs-tm.h): New rule.
+ (cs-config.h, cs-hconfig.h, cs-tconfig.h, cs-tm_p.h): Adjust
+ invocations of mkconfig.sh for changes to that program.
+ (mostlyclean): Delete print-rtl1.c.
+ (clean): Delete tm.h.
+ Update dependencies for the files listed below.
+
+ * mklibgcc.in: Add 'coretypes.h $(TM_H)' to libgcc2_c_dep.
+
+ * coretypes.h: New file.
+ * system.h: #define malloc to xmalloc and realloc to xrealloc
+ when FLEX_SCANNER or YYBISON is defined, independent of the
+ value of GCC_VERSION.
+ * alias.c, attribs.c, bb-reorder.c, bitmap.c, builtins.c,
+ c-aux-info.c, c-common.c, c-convert.c, c-decl.c, c-dump.c,
+ c-errors.c, c-format.c, c-lang.c, c-lex.c, c-objc-common.c,
+ c-opts.c, c-parse.in, c-pragma.c, c-pretty-print.c,
+ c-semantics.c, c-typeck.c, caller-save.c, calls.c, cfg.c,
+ cfganal.c, cfgbuild.c, cfgcleanup.c, cfglayout.c, cfgloop.c,
+ cfgrtl.c, collect2.c, combine.c, conflict.c, convert.c,
+ cppdefault.c, cpperror.c, cppexp.c, cppfiles.c, cpphash.c,
+ cppinit.c, cpplex.c, cpplib.c, cppmacro.c, cppmain.c,
+ cppspec.c, cpptrad.c, crtstuff.c, cse.c, cselib.c, dbxout.c,
+ debug.c, df.c, diagnostic.c, doloop.c, dominance.c,
+ dummy-conditions.c, dwarf2asm.c, dwarf2out.c, dwarfout.c,
+ emit-rtl.c, errors.c, et-forest.c, except.c, explow.c,
+ expmed.c, expr.c, final.c, fix-header.c, flow.c, fold-const.c,
+ function.c, gcc.c, gccspec.c, gcov-dump.c, gcov-iov.c, gcov.c,
+ gcse.c, gen-protos.c, genattr.c, genattrtab.c, genautomata.c,
+ gencheck.c, gencodes.c, genconditions.c, genconfig.c,
+ genconstants.c, genemit.c, genextract.c, genflags.c,
+ gengenrtl.c, gengtype-lex.l, gengtype-yacc.y, gengtype.c,
+ genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c,
+ gensupport.c, ggc-common.c, ggc-none.c, ggc-page.c,
+ ggc-simple.c, global.c, graph.c, haifa-sched.c, hashtable.c,
+ hooks.c, ifcvt.c, integrate.c, intl.c, jump.c, langhooks.c,
+ lcm.c, libgcc2.c, line-map.c, lists.c, local-alloc.c, loop.c,
+ main.c, mbchar.c, mips-tdump.c, mips-tfile.c, mkdeps.c,
+ optabs.c, params.c, predict.c, prefix.c, print-rtl.c,
+ print-tree.c, profile.c, protoize.c, ra-build.c,
+ ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, read-rtl.c,
+ real.c, recog.c, reg-stack.c, regclass.c, regmove.c,
+ regrename.c, reload.c, reload1.c, reorg.c, resource.c,
+ rtl-error.c, rtl.c, rtlanal.c, sbitmap.c, scan-decls.c,
+ scan.c, sched-deps.c, sched-ebb.c, sched-rgn.c, sched-vis.c,
+ sdbout.c, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c,
+ ssa.c, stmt.c, stor-layout.c, stringpool.c, timevar.c,
+ tlink.c, toplev.c, tracer.c, tree-dump.c, tree-inline.c,
+ tree.c, unroll.c, varasm.c, varray.c, varray.h, vmsdbgout.c,
+ xcoffout.c, config/darwin-c.c, config/darwin.c,
+ config/fp-bit.c, config/alpha/alpha.c, config/alpha/vms-cc.c,
+ config/alpha/vms-ld.c, config/arc/arc.c, config/arm/arm.c,
+ config/arm/pe.c, config/avr/avr.c, config/c4x/c4x-c.c,
+ config/c4x/c4x.c, config/cris/cris.c, config/d30v/d30v.c,
+ config/dsp16xx/dsp16xx.c, config/fr30/fr30.c,
+ config/frv/frv.c, config/h8300/h8300.c, config/i370/i370-c.c,
+ config/i370/i370.c, config/i386/i386.c, config/i386/winnt.c,
+ config/i960/i960-c.c, config/i960/i960.c,
+ config/ia64/ia64-c.c, config/ia64/ia64.c, config/ip2k/ip2k.c,
+ config/m32r/m32r.c, config/m68hc11/m68hc11.c,
+ config/m68k/m68k.c, config/m88k/m88k.c, config/mcore/mcore.c,
+ config/mips/irix6-libc-compat.c, config/mips/mips.c,
+ config/mmix/mmix.c, config/mn10200/mn10200.c,
+ config/mn10300/mn10300.c, config/ns32k/ns32k.c,
+ config/pa/pa.c, config/pdp11/pdp11.c, config/romp/romp.c,
+ config/rs6000/rs6000-c.c, config/rs6000/rs6000.c,
+ config/s390/s390.c, config/sh/sh.c, config/sparc/gmon-sol2.c,
+ config/sparc/sparc.c, config/stormy16/stormy16.c,
+ config/v850/v850-c.c, config/v850/v850.c, config/vax/vax.c,
+ config/xtensa/xtensa.c, objc/objc-act.c, objc/objc-lang.c:
+ Include coretypes.h and tm.h.
+
+ * genattrtab.c, genconditions.c, genemit.c, genextract.c,
+ gengenrtl.c, gengtype.c, genopinit.c, genoutput.c, genpeep.c,
+ genrecog.c: Include coretypes.h and tm.h from the file
+ generated by this program.
+
+ * unwind-dw2-fde-darwin.c, unwind-dw2-fde-glibc.c,
+ unwind-dw2-fde.c, unwind-dw2.c, unwind-sjlj.c: Include
+ coretypes.h and tm.h, and tsystem.h when not already included.
+ No need to include stddef.h nor stdlib.h.
+
+ * fixinc/fixlib.h: Include coretypes.h and tm.h. Do not
+ include auto-host.h or ansidecl.h/
+ * fixinc/server.h: Do not include stdio.h, unistd.h, or fixlib.h.
+ * fixinc/procopen.c: Include server.h after fixlib.h. Do not
+ include auto-host.h, ansidecl.h, or system.h.
+ * fixinc/server.c: Likewise. Also, do not include signal.h,
+ and do not redefine volatile.
+
+Sat Nov 30 17:16:46 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (movdf_integer): Always enable in 64bit.
+ (movdf_nointeger): Always disable in 64bit.
+
2002-11-30 John David Anglin <dave@hiauly1.hia.nrc.ca>
* cfg.c (dump_flow_info): Use max_reg_num () to determine the largest
pseudo register number plus 1.
+Fri Nov 29 20:10:56 2002 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * expmed.c (store_bit_field): Use int_mode_for_mode to find
+ corresponding mode of non-integer mode, unless it is VOIDmode.
+
2002-11-29 Hans-Peter Nilsson <hp@bitrange.com>
* cpplib.c (_cpp_test_assertion): Default *value to 0.
@@ -571,6 +929,20 @@ Mon Dec 2 14:43:22 2002 J"orn Rennecke <joern.rennecke@superh.com>
Do not accept bit tests with the MSB.
(*tst_extzv_memqi_1_n): New.
+Thu Nov 28 23:56:24 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_expand_int_movcc): Add copy_rtx to avoid invalid RTX
+ sharing when operand is SUBREG.
+
+Thu Nov 28 08:57:26 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * athlon.md (athlon-decodev): New reservation unit.
+ (athlon-direct0): New reservation.
+ (athlon-vector): New use athlon-decodev.
+ (athlon-double, athlon-direct): Better model.
+ (athlon_imul_k8): Use athlon-direct0.
+ (athlon_movlpd_load): New insn reservation.
+
2002-11-28 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.c (h8300_eightbit_constant_address_p):
@@ -598,6 +970,14 @@ Mon Dec 2 14:43:22 2002 J"orn Rennecke <joern.rennecke@superh.com>
* config/h8300/h8300-protos.h: Add a prototype for
h8300_and_costs.
+Wed Nov 27 20:34:13 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (x86_sse_partial_regs_for_cvtsd2ss): New.
+ * i386.h (x86_sse_partial_regs_for_cvtsd2ss): Declare.
+ (TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS): New macro.
+ * i386.md (truncdfsf patterns and splitters): Use
+ TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS
+
2002-11-27 Zack Weinberg <zack@codesourcery.com>
* config/rs6000/rs6000.c (altivec_init_builtins): Make the
@@ -667,6 +1047,51 @@ Wed Nov 27 14:45:46 CET 2002 Jan Hubicka <jh@suse.cz>
* builtins.def (DEF_C99_BUILTIN): Fix.
+2002-11-26 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/lib1funcs.asm (FUNC, ENDFUNC0, ENDFUNC): New macros.
+ (all): Add .size and .type information.
+
+Tue Nov 26 22:43:50 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_expand_int_movcc): Do not emit lea for short mode on
+ partial_reg_stall target.
+
+Tue Nov 26 22:27:47 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (movhicc): Allow general operand.
+ (movqicc): New expander.
+ (movqicc_noc): New pattern.
+ * i386.c (ix86_expand_carry_flag_compare): New function.
+ (ix86_expand_int_movcc): Optimize harder using sbb; support more
+ HImode conversion; support QImode conditional moves
+
+Tue Nov 26 16:30:59 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (FAST_PROLOGUE_INSN_COUNT): Set to 20.
+ (ix86_expand_prologue): Multiply the count by amount of registers to be
+ pushed.
+
+Tue Nov 26 15:55:27 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (override_options): Error about wrong -mcpu on x86-64
+ compilation.
+
+2002-11-26 NIIBE Yutaka <gniibe@m17n.org>
+
+ * config/sh/linux.h (FUNCTION_PROFILER): Implemented.
+
+Tue Nov 26 00:14:20 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386-protos.h (x86_extended_QIreg_mentioned_p,
+ x86_extended_reg_mentioned_p): Declare.
+ * i386.c (extended_reg_mentioned_1): New static function.
+ (x86_extended_QIreg_mentioned_p,
+ x86_extended_reg_mentioned_p): New global functions.
+ * i386.h (REX_SSE_REGNO_P): New macro.
+ * i386.md (prefix_rex): New attribute.
+ (length attribute): Add rex.
+
2002-11-26 Andrew Haley <aph@redhat.com>
* unwind-sjlj.c (_Unwind_FindEnclosingFunction): Rename
@@ -797,6 +1222,10 @@ Wed Nov 27 14:45:46 CET 2002 Jan Hubicka <jh@suse.cz>
* crtstuff.c (EH_FRAME_SECTION_CONST): Define.
(__EH_FRAME_BEGIN__, __FRAME_END__): Add it.
+Mon Nov 25 18:32:37 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (pushsf_rex64): Fix typo.
+
2002-11-25 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/spe.h (__ev_create_sfix32_fs): Change macro into
@@ -912,6 +1341,14 @@ Wed Nov 27 14:45:46 CET 2002 Jan Hubicka <jh@suse.cz>
* unwind-sjlj.c (_Unwind_Find_Enclosing_Function): Likewise.
* unwind-dw2.c (_Unwind_Find_Enclosing_Function): Likewise.
+Sun Nov 24 10:38:04 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (x86_use_ffreep): New global variable.
+ * i386.h (x86_use_frfeep): Declare
+ (TARGET_USE_FFREEP): New macro
+ * i386.md (movs?f*): Use freep when asked for.
+ (push?f): Remove dead code.
+
2002-11-24 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.c (h8300_init_once): Fix a typo in the
@@ -951,6 +1388,19 @@ Wed Nov 27 14:45:46 CET 2002 Jan Hubicka <jh@suse.cz>
* config/m68k/m68k.c: Fix typo in last change defining
TARGET_ASM_CAN_OUTPUT_MI_THUNK.
+2002-11-23 H.J. Lu <hjl@gnu.org>
+
+ * aclocal.m4: Include ../config/accross.m4.
+ (gcc_AC_COMPILE_CHECK_SIZEOF): Removed.
+ (gcc_AC_C_COMPILE_ENDIAN): Removed.
+ (gcc_AC_C_FLOAT_FORMAT): Check $ac_cv_c_bigendian
+ instead of $ac_cv_c_compile_endian.
+
+ * configure.in: Replace gcc_AC_COMPILE_CHECK_SIZEOF with
+ AC_COMPILE_CHECK_SIZEOF.
+ Replace gcc_AC_C_COMPILE_ENDIAN with AC_C_BIGENDIAN_CROSS.
+ * configure: Rebuild.
+
2002-11-23 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.c (print_operand): Update the use of
@@ -987,6 +1437,24 @@ Wed Nov 27 14:45:46 CET 2002 Jan Hubicka <jh@suse.cz>
* config/h8300/h8300.c (compute_a_shift_length): Fix the insn
length computation when xor.l is output.
+2002-11-21 Douglas B Rupp <rupp@gnat.com>
+
+ * alpha.md (movstrdi, clrstrdi): New VMS patterns.
+ (call_vms_1, call_value_vms_1): Cleanup syntax.
+
+Thu Nov 21 19:20:27 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * athlon.md (define_atuomaton): Add athlon_load.
+ (athlon-double): New reservation.
+ (athlon-ieu0): New CPU unit.
+ (athlon-load?): Use athlon_load automaton.
+ (*_k8 reservations): New.
+ (other insn revervations): Activate for K8.
+
+Thu Nov 21 15:07:42 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * cfgrtl.c (verify_flow_info): Accept EDGE_CAN_FALLTHRU flag.
+
2002-11-21 Jim Wilson <wilson@redhat.com>
* config/rs6000/rs6000.c (function_arg): Set inner mode of SPE
@@ -1073,6 +1541,55 @@ Thu Nov 21 23:52:04 CET 2002 Jan Hubicka <jH@suse.cz>
stack padding to an aligned boundary if it has no frame.
(thumb_get_frame_size): Likewise.
+Wed Nov 20 22:25:53 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * x86-64.h (MCOUNT_NAME): Fix typo in my previous patch.
+ (override_options): Likewise.
+
+Wed Nov 20 19:07:17 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * config.gcc: Add k8 target alias support
+ * i386.c (_cost): Declare costs for various variants of divides and
+ multiplies.
+ (k8_cost): New.
+ (m_K8, m_ATHLON_K8): New macros.
+ (x86_use_leave, x86_push_memory, x86_movx, x86_unroll_strlen,
+ x86_cmove, x86_3dnow_a, x86_deep_branch, x86_use_fiop,
+ x86_promote_QImode, x86_sub_esp_?, x86_add_esp_?,
+ x86_integer_DFmode_moves, x86_partial_reg_dependency,
+ x86_memory_mismatch_stall, x86_accumulate_outgoing_args,
+ x86_prologue_using_move, x86_epilogue_using_move,
+ x86_arch_always_fancy_math_387, x86_sse_partial_regs,
+ x86_sse_typeless_stores): Set for K8
+ (override_options): Add k8 support; fix athlon alignment;
+ complain about non-x86-64 capable CPU being used in x86-64 compilation.
+ (ix86_issue_rate): Set for K8.
+ (ix86_adjust_cost, ia32_use_dfa_pipeline_interface,
+ x86_machine_dependent_reorg): Handle K8 like
+ * i386.h
+ (x86_costs): Change mult_init and divide into array.
+ (TARGET_K8, TARGET_ATHLON): New macros.
+ (MODE_INDEX): New macro.
+ (RTX_COST): Use new costs.
+ (TARGET_CPU_CPP_BUILTINS): Define __k8__ and __tune_k8__.
+ (TARGET_CPU_DEFAULT_NAMES): Add k8
+ (TARGET_CPU_DEFAULT_k8): New constant
+ (enum processor_type): Add PROCESSOR_K8.
+ * i386.md (cpu attribute): Add k8.
+
+ * invoke.texi: Document -march=k8.
+
+ * i386.md (type attribute): Add leave
+ (mode attribute): Remove unknownfp.
+ (length_immediate, modrm, memory attributes): Handle leave correctly.
+ (fp comparison patterns): Determine FP mode.
+ (leave, leave_rex64): Remove special cases.
+ * ppro.md (ppro_uops, ppro_p2): Add leave
+ * pentiun.md (pent_pop): Handle leave too.
+ * k6.md (k6_load): Handle leave.
+ * athlon.md (athlon_leave, athlon_pop): Fix.
+ (athlon_decode): Handle leave.
+
2002-11-20 Steve Ellcey <sje@cup.hp.com>
* emit-rtl.c (gen_reg_rtx): Simplify mapping of Complex type
@@ -1159,6 +1676,78 @@ Thu Nov 21 23:52:04 CET 2002 Jan Hubicka <jH@suse.cz>
* combine.c (force_to_mode): Only replace with (not Y) if all bits in fuller_mask
(not just mask) are set in C.
+2002-11-19 Steven Bosscher <steven.bosscher@usafa.af.mil>
+
+ * config/mips/vr.h (DRIVER_SELF_SPECS): Change %{<mgp32} to %<mgp32.
+
+2002-11-19 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * profile.c (index_counts_file): Fix obvious mistake.
+
+2002-11-19 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * Makefile.in (profile.o): Add hashtab.h dependency.
+ * gcov-io.h (GCOV_SUMMARY_LENGTH): New.
+ * profile.c: Include hashtab.h.
+ (htab_counts_index_hash, htab_counts_index_eq, htab_counts_index_del,
+ cleanup_counts_index, index_counts_file, struct section_reference,
+ struct da_index_entry, counts_file_name, counts_file_index): New.
+ (get_exec_counts, init_branch_prob): Modified.
+
+2002-11-19 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config.gcc (sh*-*-linux*): Add t-slibgcc-elf-ver and t-linux
+ to tmake_file. Remove setting gas and gnu_ld here.
+ * config/sh/libgcc-glibc.ver: New file.
+ * config/sh/t-linux (EXTRA_MULTILIB_PARTS): Add crtbeginT.o.
+ (SHLIB_MAPFILES): New.
+ * config/sh/linux.h (MD_EXEC_PREFIX): Undefine.
+ (MD_STARTFILE_PREFIX): Likewise.
+ (HANDLE_PRAGMA_PACK_PACK_PUSH_POP): Define.
+ (DWARF2_UNWIND_INFO): Redefine.
+ (ASM_PREFERRED_EH_DATA_FORMAT): Define.
+ (LINK_EH_SPEC): Redefine.
+ (MD_FALLBACK_FRAME_STATE_FOR): Define except for SH-media.
+ (SH_FALLBACK_FRAME_FLOAT_STATE): Define.
+ (SH_DWARF_FRAME_GP0, SH_DWARF_FRAME_FP0, SH_DWARF_FRAME_XD0,
+ SH_DWARF_FRAME_BT0, SH_DWARF_FRAME_PR, SH_DWARF_FRAME_PR_MEDIA,
+ SH_DWARF_FRAME_GBR, SH_DWARF_FRAME_MACH, SH_DWARF_FRAME_MACL,
+ SH_DWARF_FRAME_PC, SH_DWARF_FRAME_SR, SH_DWARF_FRAME_FPUL,
+ SH_DWARF_FRAME_FPSCR): Likewise.
+ * config/sh/sh-protos.h (sh_set_return_address): Declare.
+ * config/sh/sh.c (calc_live_regs): Count EH_RETURN_DATA_REGNO
+ registers if the current function calls EH return.
+ (sh_expand_epilogue): Handle EH stack adjustments.
+ (sh_set_return_address): New function.
+ * config/sh/sh.h (SH_DBX_REGISTER_NUMBER): Handle PR_MEDIA_REG.
+ Don't abort even if the number is mapped to -1.
+ (EH_RETURN_DATA_REGNO): Define.
+ (EH_RETURN_STACKADJ_RTX): Define.
+ * config/sh/sh.md (UNSPEC_EH_RETURN): New.
+ (eh_return): New pattern.
+ (eh_set_ra_di, eh_set_ra_si): Likewise.
+ Add splitter to perform EH return after reload.
+
+Tue Nov 19 12:52:07 2002 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * stor-layout.c (excess_unit_span): New function.
+ (place_field): Use it.
+
+2002-11-19 Andreas Schwab <schwab@suse.de>
+
+ * unwind.h (_Unwind_GetTextRelBase): Revert last change, this is
+ not valid in C++.
+
+2002-11-19 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * configure.in, Makefile.in: Correct BUILD/HOST confusion.
+ * configure: Regenerate.
+
+Tue Nov 19 00:11:44 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * convert.c (strip_float_extensions): New function.
+ (convert_to_real): Optimize some cases.
+
2002-11-19 Andreas Jaeger <aj@suse.de>
* loop.c (record_giv): Initialize not_replaceable.
@@ -1326,6 +1915,13 @@ Sun Nov 17 00:01:28 CET 2002 Jan Hubicka <jh@suse.cz>
* config/sh/sh.md (initialize_trampoline): Do not force the
trampoline address into R0_REGS here.
+Sun Nov 17 14:01:09 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (negsf2_ifs, negdf2_ifs, negdf2_ifs_rex64, abssf2_ifs,
+ absdf2_ifs, absdf2_ifs_rex64): Fix constraints.
+ (neg?f2_ifs, abs?f2_ifs splitters): Refuse memory operand; do not
+ generate unnecesary subregs.
+
2002-11-17 Kazu Hirata <kazu@cs.umass.edu>
* df.c: Fix formatting.
@@ -1349,6 +1945,23 @@ Sun Nov 17 00:01:28 CET 2002 Jan Hubicka <jh@suse.cz>
* builtins.c: Fix formatting.
+Sat Nov 16 16:49:58 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (truncdfsf2_1_sse, truncdfsf2_1_sse_nooverlap, truncdfsf2_2,
+ floats?dff2_i387):
+ Work around regclass stupidity.
+ (truncdfsf_2_1_sse splitter): Accept !TARGET_PARTIAL_SSE_REGS
+
+Sat Nov 16 02:17:48 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (fop_df_6): New pattern.
+ (fop_xf_4, fop_xf_5): Handle both SF and DFmode extensions.
+ (fop_xf_6): Rewrite
+ (fop_xf_7): Delete.
+ (fop_tf_4, fop_tf_5): Handle both SF and DFmode extensions.
+ (fop_tf_6): Rewrite
+ (fop_tf_7): Delete.
+
2002-11-16 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.md (two anonymous patterns): Fix typos.
@@ -1489,6 +2102,12 @@ Fri Nov 15 14:54:19 CET 2002 Jan Hubicka <jh@suse.cz>
* gthr-posix.h: Fix formatting.
+2002-11-12 Devang Patel <dpatel@apple.com>
+
+ * gcc.c (display_help): Two new options -Xpreprocessor and -Xassembler.
+ (process_command): Same.
+ * doc/invoke.texi: Info about these two new options.
+
2002-11-12 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.md (*andorsi3): New.
@@ -1602,6 +2221,18 @@ Sun Nov 10 18:49:21 CET 2002 Jan Hubicka <jh@suse.cz>
* config/mmix/mmix.h (FUNCTION_ARG_CALLEE_COPIES): Define the same
as FUNCTION_ARG_PASS_BY_REFERENCE.
+2002-11-09 Zack Weinberg <zack@codesourcery.com>
+
+ * doc/install.texi: Add *-*-vxworks* specific installation
+ instructions.
+
+ * config/vxlib.c: Rewrite using generation numbers to identify
+ valid TSD keys.
+
+Sat Nov 9 00:10:54 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (x86_machine_dependent_reorg): Fix even more side cases.
+
2002-11-09 John David Anglin <dave@hiauly1.hia.nrc.ca>
* pa.h (STARTING_FRAME_OFFSET): Change offset for TARGET_64BIT to 16.
@@ -1645,6 +2276,43 @@ Sun Nov 10 18:49:21 CET 2002 Jan Hubicka <jh@suse.cz>
* c-opts.c (COMMAND_LINE_OPTIONS): Fix -Wimplicit.
+2002-11-08 Roger Sayle <roger@eyesopen.com>
+
+ * real.c (real_sqrt): Update comment with bibliographic reference.
+
+Fri Nov 8 13:33:58 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (sse_loadss, sse2_loadsd): Fix expander.
+
+Fri Nov 8 13:25:41 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (x86_machine_dependent_reorg): Fix handling of empty functions.
+
+Fri Nov 8 13:01:42 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * builtins.c (expand_builtin_mathfn): Handle floor/ceil/trunc/round/nearbyint
+ (expand_builtin): Likewise.
+ * builtins.def: Add
+ __builtin_floor, __builtin_floorf, __builtin_floorl
+ __builtin_ceil, __builtin_ceilf, __builtin_ceill
+ __builtin_round, __builtin_roundf, __builtin_roundl
+ __builtin_trunc, __builtin_truncf, __builtin_truncl
+ __builtin_nearbyint, __builtin_nearbyintf, __builtin_nearbyintl.
+ * genopinit.c (optabs): Initialize the new optabs.
+ * optab.c (init_optabs): Likewise.
+ * optabs.h (optab_index): Add OTI_floor, OTI_ceil, OTI_trunc,
+ OTI_round, OTI_nearbyint.
+ (floor_optab, ceil_optab, trunc_optab, round_optab, nearbyint_optab): New.
+ * doc/md.texi: Document new named patterns.
+ * doc/extend.texi (builtin functions) Document
+ floor, floorf, floorl, ceil, ceilf,
+ ceill, round, roundf, roundl, trunc,
+ truncf, truncl, nearbyint, nearbyintf, nearbyintl.
+
+Fri Nov 8 11:36:11 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (sse_movdfcc, sse_movsfcc): Fix typo in previous patch.
+
2002-11-08 Dale Johannesen <dalej@apple.com>
* dbxout.c (dbxout_type): Fix stabs info for vector types.
@@ -1669,6 +2337,11 @@ Fri Nov 8 11:20:19 CET 2002 Jan Hubicka <jh@suse.cz>
* jump.c (mark_jump_label): Handle subregs of label_refs.
+Thu Nov 7 21:54:22 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (sse_movdfcc, sse_movsfcc): Avoid overactive matching.
+ * i386.c (ix86_expand_fp_movcc): Match the reversed cases.
+
2002-11-07 David Mosberger <davidm@hpl.hp.com>
* config/ia64/crtend.asm: Include "auto-host.h".
@@ -1741,6 +2414,44 @@ Thu Nov 7 11:18:01 CET 2002 Jan Hubicka <jh@suse.cz>
* config/rs6000/t-darwin: Delete contents duplicated in t-rs6000
or config/t-darwin.
+2002-11-06 Douglas B Rupp <rupp@gnat.com>
+
+ * config/i386/i386-interix.h (TARGET_SUBTARGET_DEFAULT): Or
+ MASK_MS_BITFIELD_LAYOUT
+ (SUBTARGET_OVERRIDE_OPTIONS): Warn about and turn off
+ MS bitfields for Objective-C.
+ (PCC_BIT_FIELD_TYPE_TEST, GROUP_BITFIELDS_BY_ALIGN): Remove
+ defines.
+
+ * config/i386/i386.c (ix86_ms_bitfield_layout): New function.
+ (TARGET_MS_BITFIELD_LAYOUT_P): Define to above function.
+ (TARGET_USE_MS_BITFIELD_LAYOUT): Define.
+
+ * config/i386/i386.h (MASK_MS_BITFIELD_LAYOUT: New mask.
+ TARGET_USE_MS_BITFIELD_LAYOUT): New macro.
+ (TARGET_SWITCHES): Add above mask.
+
+ * testsuite/gcc.dg/bf-ms-layout.c: New test case.
+ * testsuite/gcc.dg/bf-no-ms-layout.c: New test case.
+ * testsuite/gcc.dg/i386-bitfield1.c (dg-options): Add appropriate
+ flags for interix.
+
+Wed Nov 6 18:54:47 2002 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/mips/mips.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output
+ .gpword/.gpdword for ABI_N32 and ABI_64 too, if using the GNU
+ assembler.
+ * config/mips/mips.md (tablejump_internal3): Output .cpadd
+ before jump on ABI_N32 too.
+ (tablejump_internal4): Ditto on ABI_64. Increase maximum
+ length to match.
+
+Wed Nov 6 17:16:48 CET 2002 Jan Hubicka <jh@.suse.cz>
+
+ * i386.md (negsf splitter): Accept memory operand in second register.
+ (abssf/absdf splitters): Simplify
+ (sse_loadss, sse_loadsd): Turn into expander.
+
2002-11-06 David Edelsohn <edelsohn@gnu.org>
PR target/8480
@@ -1764,6 +2475,12 @@ Thu Nov 7 11:18:01 CET 2002 Jan Hubicka <jh@suse.cz>
* config/mips/mips.md (call_value_multiple_internal2): Use dla for
non-SImode addresses.
+Tue Nov 5 14:34:36 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (float_truncate SSE splitter): Ensure that operand is not
+ stack register.
+ (float SSE splitters): Reorder conditional.
+
2002-11-05 Bob Wilson <bob.wilson@acm.org>
* config/xtensa/elf.h (LIB_SPEC): Add "-lhal".
@@ -1783,6 +2500,15 @@ Thu Nov 7 11:18:01 CET 2002 Jan Hubicka <jh@suse.cz>
* config/mips/mips.h (CANNOT_CHANGE_MODE_CLASS): Move comment to...
* config/mips/mips.c (mips_cannot_change_mode_class): ...here.
+2002-11-04 Zack Weinberg <zack@codesourcery.com>
+
+ * gthr-vxworks.h: Rewritten from scratch.
+ * config/vxlib.c: New file.
+ * config/t-vxworks: Add config/vxlib.c to LIB2FUNCS_EXTRA.
+ * config/rs6000/t-vxworks: Add config/vxlib.c to
+ LIB2FUNCS_EXTRA here too, because of clash with
+ config/rs6000/t-ppccomm.
+
2002-11-04 Dale Johannesen <dalej@apple.com>
* doloop.c (doloop_modify_runtime): Fix loop count computation
@@ -1876,6 +2602,14 @@ Thu Nov 7 11:18:01 CET 2002 Jan Hubicka <jh@suse.cz>
Include hard-reg-set and basic-block.
(REG_CHANGES_MODE): Delete.
+2002-11-03 Roger Sayle <roger@eyesopen.com>
+
+ * real.c (real_sqrt): New function to calculate square roots.
+ * real.h (real_sqrt): Add function prototype.
+ * builtins.c (fold_builtin): Fold sqrt of constant argument.
+ * simplify-rtx.c (simplify_unary_operation): Simplify sqrt
+ of constant argument.
+
2002-11-03 John David Anglin <dave@hiauly1.hia.nrc.ca>
* jump.c (never_reached_warning): Don't set contains_insn until the
@@ -1997,6 +2731,16 @@ Fri Nov 1 10:33:15 CET 2002 Jan Hubicka <jh@suse.cz>
* expr.c (emit_move_insn): Use SCALAR_FLOAT_MODE_P
* machmode.h (SCALAR_FLOAT_MODE_P): New macro.
+Thu Oct 31 18:20:50 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (sse_loadss, sse_loadsd): Canonicalize; add expander
+ (movps, movpd splitters): Use canonical form.
+ (movv2di): Fix merge problem.
+
+Thu Oct 31 16:22:31 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (negdf2_ifs_rex64): Don't allow GPR operand.
+
2002-10-31 Nathanael Nerode <neroden@gcc.gnu.org>
PR optimization/6162
@@ -2048,6 +2792,13 @@ Thu Oct 31 12:45:55 2002 J"orn Rennecke <joern.rennecke@superh.com>
* config/sparc/freebsd.h (TRANSFER_FROM_TRAMPOLINE): Define
__enable_execute_stack function.
+2002-10-30 Zack Weinberg <zack@codesourcery.com>
+
+ * gthr.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h,
+ gthr-solaris.h, gthr-win32.h: Remove __gthread_key_dtor.
+ * unwind-sjlj.c (fc_key_dtor): Delete.
+ (fc_key_init): Adjust __gthread_key_create call to match.
+
2002-10-30 Aldy Hernandez <aldyh@redhat.com>
* c-common.c: Add GTY to vector_type_node_list.
@@ -2122,6 +2873,34 @@ Thu Oct 31 12:45:55 2002 J"orn Rennecke <joern.rennecke@superh.com>
* config/h8300/h8300.c (h8300_eightbit_constant_address_p):
Truncate the addresses for H8/300 using HImode.
+Tue Oct 29 23:28:10 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (negdf splitter): Fix construction of the constant.
+
+Tue Oct 29 20:47:06 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (negsf, negdf): Reorganize to use vector modes
+ for SSE variants.
+ (abssf, absdf): Use force_reg.
+ (movv4sf, movv2df): New splitters.
+ * i386.h (PREDICATE_CODES): add zero_extended_scalar_load_operand
+ * i386.c (zero_extended_scalar_load_operand
+
+ * i386-protos.h (ix86_expand_call): Update prototype.
+ * i386.c (ix86_function_ok_for_sibcall): Handle 64bit
+ (ix86_expand_call): Use r11 for indirect sibcalls.
+ * i386.md (call, call_value, untyped_call, call_value_pop):
+ update x86_expand_call call.
+ (sibcall, sibcall_value): new patterns
+ (call_rex64, call_value_rex64): Do not accept sibcalls.
+ (sibcall_rex64, sibcall_value_rex64,
+ sibcall_rex64_v, sibcall_value_rex64_v): New.
+
+Tue Oct 29 15:37:39 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * toplev.c (rest_of_compilation): Reorganize way reg_scan is called
+ before final pass.
+
2002-10-29 Hans-Peter Nilsson <hp@bitrange.com>
* toplev.c (rest_of_type_compilation): Return early in case of
@@ -2206,6 +2985,30 @@ Tue Oct 29 15:37:39 CET 2002 Jan Hubicka <jh@suse.cz>
* config/h8300/h8300.h (MASK_*): New.
(TARGET_*): Use MASK_*.
+2002-10-28 Zack Weinberg <zack@codesourcery.com>
+
+ * config.gcc (*-*-vxworks, powerpc-wrs-vxworks*): New stanzas.
+ * config/t-vxworks, config/vxworks.h, config/rs6000/t-vxworks,
+ config/rs6000/vxworks.h: New files.
+ * config/rs6000/sysv4.h: Rip out -mvxworks and all related code.
+
+ * config.gcc (alpha*-*-vxworks*, arm-*-vxworks*,
+ i?86-wrs-vxworks*, i960-wrs-vxworks* [all],
+ m68k-wrs-vxworks*, mips-wrs-vxworks, powerpc-wrs-vxworks*,
+ powerpcle-wrs-vxworks*, sparc*-wrs-vxworks* [all],
+ sparc-*-vxsim*): Delete stanzas.
+ * gthr-vxworks.h: Rip out all substantive code and just
+ include gthr-single.h.
+
+ * config/alpha/vxworks.h, config/arm/vxarm.h,
+ config/i386/vxi386.h, config/i960/t-vxworks960,
+ config/i960/vx960-coff.h, config/i960/vx960.h,
+ config/m68k/t-vxworks68, config/m68k/vxm68k.h,
+ config/mips/vxworks.h, config/rs6000/vxppc.h,
+ config/sparc/t-vxsparc, config/sparc/t-vxsparc64,
+ config/sparc/vxsim.h, config/sparc/vxsparc.h,
+ config/sparc/vxsparc64.h: Delete files.
+
2002-10-28 Jason Thorpe <thorpej@wasabisystems.com>
* config.gcc (*-*-netbsd*): Add NETBSD_ENABLE_PTHREADS to
@@ -2281,10 +3084,17 @@ Sun Oct 27 10:15:24 CET 2002 Jan Hubicka <jh@suse.cz>
* config/mmix/mmix.md ("fixuns_truncdfdi2"): Replace unsigned_fix,
invalid for floating point mode result, with fix.
+Fri Oct 25 00:04:21 2002 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (GCC_FOR_TARGET): Add -L$(objdir)/../ld.
+ (STAGE2_FLAGS_TO_PASS): Pass GCC_FOR_TARGET.
+ (stage1_build): Likewise.
+
2002-10-25 Mike Stump <mrs@apple.com>
Fixes gcc.dg/warn-1.c.
- * c-typeck.c (warn_for_assignment): Don't print argument number, if zero.
+ * c-typeck.c (warn_for_assignment): Don't print argument number,
+ if zero.
Sat Oct 26 01:44:46 CEST 2002 Jan Hubicka <jh@suse.cz>
@@ -2413,6 +3223,20 @@ Sat Oct 26 01:44:46 CEST 2002 Jan Hubicka <jh@suse.cz>
* optabs.c (expand_binop): Don't reuse the shift target in the
middle of shift sequences.
+Wed Oct 23 22:48:44 CEST 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (abs splitters): Do not produce nested subregs.
+
+Wed Oct 23 12:42:32 CEST 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (movti_rex64): Fix constraints.
+
+Wed Oct 23 12:01:21 CEST 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (abssf,absdf): Use vector operands for SSE
+ (abssf2_ifs, absdf2_ifs, absdf2_ifs_rex64 and splitters): Update for
+ vector operand.
+
2002-10-23 Ziemowit Laski <zlaski@apple.com>
* objc/objc-act.c (get_static_reference): Remove unneeded
@@ -2633,6 +3457,11 @@ Tue Oct 22 19:07:03 CEST 2002 Jan Hubicka <jh@suse.cz>
2002-10-21 Richard Henderson <rth@redhat.com>
+ * config/i386/i386.c (ix86_function_ok_for_sibcall): Look at
+ the function type, not the return type.
+
+2002-10-21 Richard Henderson <rth@redhat.com>
+
* real.c (sticky_rshift_significand): Return inexact, don't
or it in immediately.
(sub_significands): Accept incomming carry.
@@ -2785,6 +3614,12 @@ Tue Oct 22 00:04:20 CEST 2002 Jan Hubicka <jh@suse.cz>
* config/h8300/h8300.h (N_REG_CLASSES): Parenthesize.
+2002-10-20 Zack Weinberg <zack@codesourcery.com>
+
+ * config/i386/i386.c (ix86_function_ok_for_sibcall): Fix an
+ inverted test in the conditional determining the possibility
+ of sibcalls in PIC mode.
+
2002-10-20 Richard Henderson <rth@redhat.com>
* target.h (struct gcc_target): Line wrap.
@@ -2848,6 +3683,45 @@ Tue Oct 22 00:04:20 CEST 2002 Jan Hubicka <jh@suse.cz>
-fno-sched-spec, -fsched-spec-load, -fsched-spec-load-dangerous,
-fsched-verbose=n, -fno-branch-count-reg and -fbounds-check.
+Sat Oct 19 22:02:28 2002 Alexandre Oliva <aoliva@redhat.com>
+ Angela Marie Thomas <angela@releasedominatrix.com>
+ Brendan Kehoe <brendan@zen.org>
+ Nick Clifton <nickc@redhat.com>
+ Andrew Haley <aph@redhat.com>
+
+ * configure.in (--with-sysroot): New. Don't inhibit libc if
+ given. AC_SUBST TARGET_SYSTEM_ROOT, TARGET_SYSTEM_ROOT_DEFINE
+ and CROSS_SYSTEM_HEADER_DIR.
+ * configure: Rebuilt.
+ * Makefile.in (CROSS_SYSTEM_HEADER_DIR): Set in configure.
+ (TARGET_SYSTEM_ROOT): New.
+ (DRIVER_DEFINES): Define CROSS_INCLUDE_DIR from
+ CROSS_SYSTEM_HEADER_DIR.
+ (install-gcc-tooldir): New target.
+ (stmp-fixinc): Do not create $(libsubdir), but rather bail out
+ if SYSTEM_HEADER_DIR does not exist and it's not the default
+ sys-include directory.
+ (deduced.h, stmp-fixproto): Quote SYSTEM_HEADER_DIR properly.
+ (install-mkheaders): Likewise.
+ * gcc.c (target_system_root): New variable.
+ (add_sysrooted_prefix): New function.
+ (process_command): Recompute run-time target_system_root from
+ gcc_exec_prefix, keeping it unchanged if the relocated sysroot
+ does not exist.
+ (do_spec_1): Process 'R' spec.
+ (main): Add md_exec_prefix to exec_prefixes regardless of
+ startfile_prefix_spec. Use add_sysrooted_prefix for
+ startfile_prefixes, and don't skip the default ones when cross
+ compiling with sysroot enabled. Removed unused case of
+ non-absolute standard_startfile_prefix.
+ * config/interix.h: Remove the only potential, yet disabled,
+ occurrence of non-absolute (empty) standard_startfile_prefix.
+ * config/sh/linux.h (LIB_SPEC): Add -rpath-link in non-static
+ linking.
+ * config/mips/linux.h (LIB_SPEC): Define as in sh/linux.h.
+ * doc/install.texi (--with-sysroot): Document.
+ (--with-headers, --with-libs): Deprecate.
+
2002-10-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
Mark Mitchell <mark@codesourcery.com>
@@ -3041,6 +3915,11 @@ Sat Oct 19 10:46:52 CEST 2002 Jan Hubicka <jh@suse.cz>
* config/i386/i386.h (TARGET_64BIT): Expand to a compile-time
constant if building libgcc2.
+Thu Oct 17 17:40:05 CEST 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (pentium4_cost): Fix according to Intel recommendations.
+ (ix86_memory_move_cost): Fix for 64bit compilation.
+
2002-10-17 Roger Sayle <roger@eyesopen.com>
* doc/c-tree.texi: Update description of COND_EXPR tree nodes.
@@ -3132,6 +4011,12 @@ Wed Oct 16 15:01:29 CEST 2002 Jan Hubicka <jh@suse.cz>
* config/s390/s390.c (s390_function_profiler): Use
ASM_GENERATE_INTERNAL_LABEL instead of LPREFIX.
+2002-10-15 Eric Christopher <echristo@redhat.com>
+
+ * stor-layout.c (layout_type): Call GET_MODE_BITSIZE once.
+ * java/parse.y (obtain_incomplete_type): Make pointer
+ ptr_mode.
+
2002-10-15 Richard Henderson <rth@redhat.com>
* real.c (real_to_decimal): Accept BUF_SIZE and CROP_TRAILING_ZEROS
@@ -3221,6 +4106,11 @@ Tue Oct 15 16:51:04 2002 J"orn Rennecke <joern.rennecke@superh.com>
* loop.c (loop_regs_scan): Mark registers used for function
argument passing as MAY_NOT_OPTIMIZE.
+Mon Oct 14 19:22:19 CEST 2002 Jan Hubicka <jh@suse.cz>
+
+ * gcov-io.h (gcov_info): Fix type.
+ * profile.c (create_profiler): Fix type mismatch.
+
Mon Oct 14 20:33:12 CEST 2002 Jan Hubicka <jh@suse.cz>
* i386.md (movv2di_internal): New pattern.
@@ -3341,8 +4231,21 @@ Mon Oct 14 11:35:49 2002 J"orn Rennecke <joern.rennecke@superh.com>
2002-10-13 Richard Henderson <rth@redhat.com>
+ * config/i386/i386.c (ix86_function_ok_for_sibcall): Reject
+ indirect sibcalls when regparm >= 3.
+
+ * config/i386/i386.c (sibcall_insn_operand): New.
+ * config/i386/i386.h (PREDICATE_CODES): Update.
+ * config/i386/i386-protos.h: Update.
+ * config/i386/i386.md (sibcall_1, sibcall_value_1): Use it.
+
* rtl.c (shallow_copy_rtx): Use memcpy for the entire node.
+2002-10-12 Roger Sayle <roger@eyesopen.com>
+
+ * simplify-rtx.c (simplify_binary_operation) [ASHIFTRT]: Optimize
+ arithmetic right shifts of ~0 during RTL simplifications.
+
2002-10-12 Neil Booth <neil@daikokuya.co.uk>
PR preprocessor/7862
@@ -3360,6 +4263,37 @@ Mon Oct 14 11:35:49 2002 J"orn Rennecke <joern.rennecke@superh.com>
* pdp11.md (movdi): Use offsetable memory for floating store.
(lshrsi3, negsi2): Delete irrelevant comment.
+2002-10-11 Andreas Bauer <baueran@in.tum.de>
+
+ * config/i386/i386.c (ix86_function_ok_for_sibcall): Allow
+ indirect calls to be sibcall optimized.
+ * config/i386/i386.md (sibcall_1): New.
+ (call_1): Add no-sibcalls condition.
+ (sibcall_value_1): New.
+ (call_value_1): Add no-sibcalls condition.
+
+2002-10-11 Eric Christopher <echristo@redhat.com>
+
+ * output.h (default_valid_pointer_mode): Declare.
+ * varasm.c (default_valid_pointer_mode): Define.
+ * target-def.h (TARGET_VALID_POINTER_MODE): Use.
+ * target.h: Ditto.
+ * tree.c (build_pointer_type_for_mode): New function.
+ (build_pointer_type): Use.
+ (build_reference_type_for_mode): New function.
+ (build_reference_type): Use.
+ * tree.h: Declare new functions.
+ * c-common.c (handle_mode_attribute): Use new functions, check
+ for type.
+ * stor-layout.c (layout_type): Depend on machine mode for
+ REFERENCE_TYPE and POINTER_TYPE.
+ * dwarf2out.c (simple_type_size_in_bits): Move upward in file.
+ (modified_type_die): Use instead of PTR_SIZE for POINTER_TYPE
+ and REFERENCE_TYPE.
+ * config/mips/mips.c (mips_valid_pointer_mode): New function.
+ (TARGET_VALID_POINTER_MODE): Use and define.
+ * config/mips/mips-protos.h (mips_valid_pointer_mode): Declare.
+
2002-10-11 Geoffrey Keating <geoffk@apple.com>
* cse.c (mention_regs): Set SUBREG_TICKED to the register number,
@@ -3406,6 +4340,23 @@ Fri Oct 11 10:56:17 2002 J"orn Rennecke <joern.rennecke@superh.com>
* emit-rtl.c (gen_lowpart_common): When asked to make a vector from
an integer, use simplify_gen_subreg.
+2002-10-10 Diego Novillo <dnovillo@redhat.com>
+
+ * calls.c (flags_from_decl_or_type): Make extern.
+ (ECF_*): Move ...
+ * rtl.h (ECF_*): ... here.
+ (flags_from_decl_or_type): Declare.
+
+2002-10-10 Roger Sayle <roger@eyesopen.com>
+ Nathan Sidwell <nathan@codesourcery.com>
+
+ * fold-const.c (fold) [RSHIFT_EXPR]: Optimize arithmetic right
+ shifts of the form -1 >> x.
+
+Thu Oct 10 16:52:55 CEST 2002 Jan Hubicka <jh@suse.cz>
+
+ * cfgcleanup.c (insn_match_p): Verify sibcall flag for calls to.
+
2002-10-10 Aldy Hernandez <aldyh@redhat.com>
* extend.texi (Vector Extensions): Remove comment about single
@@ -3474,6 +4425,13 @@ Thu Oct 10 17:08:30 CEST 2002 Jan Hubicka <jh@suse.cz>
* toplev.c (rest_of_compilation): Revert opt/2960 change.
+Wed Oct 9 21:18:43 CEST 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (*_cost): Add branch costs.
+ (override_options): set ix86_branch_cost.
+ (ix86_expand_int_movcc): Use BRANCH_COST.
+ * i386.h (costs): Add branch_cost.
+
2002-10-09 Zack Weinberg <zack@codesourcery.com>
PR c/7353
@@ -3552,6 +4510,33 @@ Wed Oct 9 15:54:49 2002 J"orn Rennecke <joern.rennecke@superh.com>
* doc/invoke.texi (Option Summary): List
-Wmissing-declarations as a C only option.
+2002-10-08 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (fold) [LROTATE_EXPR, RROTATE_EXPR]: Optimize
+ left and right rotates of ~0, i.e. integer_all_onesp (arg0).
+ [LSHIFT_EXPR, RSHIFT_EXPR]: Optimize shifts and rotates of zero.
+
+Tue Oct 8 01:24:19 CEST 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (x86_sse_partial_reg_dependency, x86_sse_partial_regs,
+ x86_sse_typeless_stores, x86_sse_load0_by_pxor): New global
+ variables.
+ (safe_vector_operand): Update sse_clrv4sf call.
+ (ix86_expand_buildin): Likewise
+ * i386.h (x86_sse_partial_reg_dependency, x86_sse_partial_regs,
+ x86_sse_typeless_stores, x86_sse_load0_by_pxor): Declare.
+ (TARGET_SSE_PARTIAL_REG_DEPENDENCY, TARGET_SSE_PARTIAL_REGS,
+ TARGET_SSE_TYPELESS_STORES, TARGET_SSE_TYPELESS_LOAD0): New
+ macros.
+ * i386.md (movsf*, movdf*, movti, movv4sf, movv2df, movv16qi, movv8hi,
+ movv4si): Obey the new flags.
+ (floatsi2sf, floatdi2sf, truncatedf2sf): Emit extra load of 0 to avoid
+ reformating penalty.
+ (anddf, cmov patterns): Avoid reformating by first converting.
+ (sse_cvtsd2ss): Fix predicate.
+ (sse2_clrti): Fix mode,
+ (sse_clrv4sf): Avoid unspec.
+
2002-10-08 Jakub Jelinek <jakub@redhat.com>
* config/sparc/t-linux64 (MULTILIB_OPTIONS): Remove
@@ -3615,6 +4600,20 @@ Tue Oct 8 16:50:10 CEST 2002 Jan Hubicka <jh@suse.cz>
* config/c4x/c4x.c (c4x_print_operand): Enlarge buffer
for REAL_VALUE_TO_DECIMAL output.
+2002-10-07 Richard Henderson <rth@redhat.com>
+
+ * cse.c (fixed_base_plus_p): Turn FIXED_BASE_PLUS_P into a
+ function; cleanup PLUS case by using recursion. Update all users.
+ (NONZERO_BASE_PLUS_P): Remove.
+ (find_comparison_args): Use rtx_addr_can_trap_p instead.
+ (fold_rtx): Use nonzero_address_p.
+ * rtl.h (nonzero_address_p): Declare.
+ * rtlanal.c (rtx_varies_p): Handle ADDRESSOF.
+ (rtx_addr_can_trap_p): Likewise.
+ (nonzero_address_p): New.
+ * simplify-rtx.c (NONZERO_BASE_PLUS_P): Remove.
+ (simplify_relational_operation): Use nonzero_address_p.
+
2002-10-07 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/rs6000.c (rs6000_override_options): Set
@@ -3658,6 +4657,10 @@ Tue Oct 8 16:50:10 CEST 2002 Jan Hubicka <jh@suse.cz>
* config/fp-bit.c (EXTENDED_FLOAT_STUBS): Flush out all XF/TFmode
entry points; use void return value and argument list.
+2002-10-06 Andreas Bauer <baueran@in.tum.de>
+
+ * calls.c (expand_call): Fix function-is-volatile check.
+
2002-10-05 Naohiko Shimizu <nshimizu@keyaki.cc.u-tokai.ac.jp>
* t-pdp11: Add MULTILIB support for msoft-float.
@@ -3717,6 +4720,12 @@ Tue Oct 8 16:50:10 CEST 2002 Jan Hubicka <jh@suse.cz>
* cppinit.c (init_standard_includes, parse_option): Use strncmp.
* c-opts.c (find_opt): Similarly.
+Sat Oct 5 22:48:06 CEST 2002 Jan Hubicka <jh@suse.cz>
+
+ * athlon.md: rewrite to DFA.
+ * i386 (ix86_adjust_cost): Drop memory latency code.
+ (ia32_use_dfa_pipeline_interface): Return true for Athlon.
+
2002-10-05 Jakub Jelinek <jakub@redhat.com>
* gcc.c (set_multilib_dir): Don't access *end.
@@ -3730,6 +4739,11 @@ Tue Oct 8 16:50:10 CEST 2002 Jan Hubicka <jh@suse.cz>
Pass all MULTILIB_* variables to genmultilib even if
--disable-multilib but MULTILIB_OSDIRNAMES is not empty.
+2002-10-04 Zack Weinberg <zack@codesourcery.com>
+
+ * gcc.c (process_command): Set .validated for -pipe. Correct
+ grammar in comment.
+
2002-10-04 Bruce Korb <bkorb@gnu.org>
* fixinc/inclhack.def(hpux11_abs): use format fix
@@ -3795,6 +4809,11 @@ Sat Oct 5 19:42:45 CEST 2002 Jan Hubicka <jh@suse.cz>
(do_divide): Apply sticky bit after normalization.
(real_to_decimal, real_to_hexadecimal): Fix sign of Inf and NaN.
+2002-10-03 Andreas Bauer <baueran@in.tum.de>
+
+ * doc/tm.texi (FUNCTION_OK_FOR_SIBCALL): Remove.
+ (TARGET_FUNCTION_OK_FOR_SIBCALL): New.
+
2002-10-03 Andreas Jaeger <aj@suse.de>
* gengtype.c (adjust_field_rtx_def): Cast variables of type size_t
@@ -3936,6 +4955,39 @@ Thu Oct 3 15:15:00 CEST 2002 Jan Hubicka <jh@suse.cz>
* pa-linux.h (FUNCTION_OK_FOR_SIBCALL): Delete macro.
* pa32-linux.h (FUNCTION_OK_FOR_SIBCALL): Define.
+2002-10-02 David Mosberger-Tang <David.Mosberger@acm.org>
+
+ * unwind.h (_Unwind_GetTextRelBase): Mark _C argument with
+ attribute "unused".
+
+ * config/t-libunwind: Mention unwind-sjlj.c.
+ * unwind-libunwind.c: Change #ifdef __USING_LIBUNWIND_EXCEPTIONS__
+ to #ifndef __USING_SJLJ_EXCEPTIONS__.
+
+ * configure.in: Move sjlj-exceptions and --enable-libunwind-exceptions
+ before inclusion of config.gcc, but after configuring the compiler etc.
+ Determine default value for --enable-libunwind-exceptions based on
+ whether the host has a libunwind library (not guaranteed to be correct,
+ but it's a reasonable first guess and can always be overridden with an
+ explicit --enable/disable-libunwind-exceptions.
+ * config.gcc: For target ia64*-*-linux*, mention t-libunwind as a
+ tmake_file when $use_libunwind_exceptions is enabled.
+ * Makefile.in: Update comment: LIB2ADDEH is updated not just by
+ ia64 (e.g., config/t-linux also updates it).
+ * gcc.c (init_spec) [USE_LIBUNWIND_EXCEPTIONS]: Mention -lunwind
+ along with the shared version of libgcc since the latter requires
+ the former.
+ * unwind-libunwind.c: New file.
+ * config/t-libunwind: Ditto.
+
+2002-10-02 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config.gcc: Remove support for vax-*-vms*.
+ * config/vax/vms.h: Remove.
+ * config/vax/xm-vms.h: Remove.
+ * config/vax/vax-protos.h: Remove VMS-specific code.
+ * config/vax/vax.c: Remove VMS-specific code.
+
2002-10-02 Richard Henderson <rth@redhat.com>
PR opt/7124
@@ -3971,6 +5023,51 @@ Wed Oct 2 17:01:36 CEST 2002 Jan Hubicka <jh@suse.cz>
* config/sparc/sparc.md (movdi_insn_sp32_v9): Accept 'e' regs.
(movdi reg/reg split): Match only on sparc32, and v9 when int regs.
+2002-10-01 Andreas Bauer <baueran@in.tum.de>
+
+ * calls.c (expand_call): Remove the `no indirect check'
+ for sibcall optimization; use function_ok_for_sibcall
+ target hook; refine check for `function is volatile'.
+ (FUNCTION_OK_FOR_SIBCALL): Remove the redefinition.
+ * hooks.c (hook_tree_tree_bool_false): New.
+ * hooks.h (hook_tree_tree_bool_false): Declare.
+ * target-def.h (TARGET_FUNCTION_OK_FOR_SIBCALL): New.
+ (TARGET_INITIALIZER): Add it.
+ * target.h (struct gcc_target): Add function_ok_for_sibcall.
+ * config/alpha/alpha.c: (alpha_function_ok_for_sibcall): New.
+ (TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly.
+ * config/alpha/alpha.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
+ * config/arm/arm-protos.h: (arm_function_ok_for_sibcall):
+ Remove function declaration.
+ * config/arm/arm.c: (arm_function_ok_for_sibcall): Make
+ function static and accept another argument of type `tree'.
+ (TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly.
+ * config/arm/arm.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
+ * config/frv/frv.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
+ * config/i386/i386.c: (ix86_function_ok_for_sibcall): New.
+ (TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly.
+ * config/i386/i386.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
+ * config/pa/pa-linux.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
+ (TARGET_HAS_STUBS_AND_ELF_SECTIONS): New definition.
+ * config/pa/pa.c: (pa_function_ok_for_sibcall): New.
+ (TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly.
+ * config/pa/pa.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
+ * config/rs6000/rs6000-protos.h: (function_ok_for_sibcall):
+ Remove function declaration.
+ * config/rs6000/rs6000.c: (rs6000_function_ok_for_sibcall):
+ Rename function_ok_for_sibcall to rs6000_function_ok_for_sibcall;
+ rename first argument to `decl'; accept another argument
+ of type `tree'; make static.
+ (TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly.
+ * config/rs6000/rs6000.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
+ * config/sh/sh.c: (sh_function_ok_for_sibcall): New.
+ (TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly.
+ * config/sh/sh.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
+ * config/sparc/sparc.c: (sparc_function_ok_for_sibcall): New.
+ (TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly.
+ * config/sparc/sparc.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
+ * config/xtensa/xtensa.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
+
2002-10-01 Roger Sayle <roger@eyesopen.com>
* unroll.c (loop_iterations): Revert 2002-09-08 change.
@@ -4105,6 +5202,14 @@ Wed Oct 2 17:01:36 CEST 2002 Jan Hubicka <jh@suse.cz>
Use mips_emit_fcc_reload.
(reload_outcc): Duplicate reload_incc.
+2002-09-30 Zack Weinberg <zack@codesourcery.com>
+
+ * gcc.c (validate_switches): Handle all new forms of spec
+ syntax introduced recently. Now returns a char *.
+ (validate_all_switches): Repetitive logic broken out to...
+ (validate_switches_from_spec): ...here.
+ * mklibgcc.in: Don't @-flag commands to generate .oS files.
+
2002-09-30 Ulrich Weigand <uweigand@de.ibm.com>
* longlong.h: Partially synchronize with GMP-4.1 version:
@@ -4163,6 +5268,10 @@ Mon Sep 30 14:57:18 CEST 2002 Jan Hubicka <jh@suse.cz>
that we have a SImode access, and only then if reload hasn't completed;
for all other cases, use LO_REGS.
+2002-09-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * openbsd.h: Fix typo in last change.
+
2002-09-29 Richard Henderson <rth@redhat.com>
* real.c (real_from_string): Apply sign last. Tidy exponent handling.
@@ -4323,6 +5432,22 @@ Mon Sep 30 14:57:18 CEST 2002 Jan Hubicka <jh@suse.cz>
(get_shift_alg): Use an enumerated type instead of numbers.
(h8300_shift_needs_scratch_p): Likewise.
+2002-09-26 Kazu Hirata <kazu@cs.umass.edu>
+
+ * varasm.c (force_data_section): Remove.
+ (assemble_constant_align): Likewise.
+ * output.h: Remove corresponding prototypes.
+
+2002-09-26 Roger Sayle <roger@eyesopen.com>
+
+ * stmt.c (expand_exit_loop_if_false): Expand a simple conditional
+ jump, if the loop to exit is the top of the current nesting stack.
+
+2002-09-26 Torbjorn Granlund <tege@swox.com>
+
+ * libgcc2.c (fixunsdfdi, fixunssfdi): Rewrite, avoiding `long long'
+ arithmetic.
+
2002-09-26 David S. Miller <davem@redhat.com>
PR optimization/7335
@@ -4457,6 +5582,21 @@ Mon Sep 30 14:57:18 CEST 2002 Jan Hubicka <jh@suse.cz>
* config.gcc: Add x prefix to v850e case for handling
--with-cpu=v850e.
+2002-09-25 Zack Weinberg <zack@codesourcery.com>
+
+ * gcc.c (input_suffix_matches, switch_matches,
+ mark_matching_switches, process_marked_switches,
+ process_brace_body): New functions - split from handle_braces.
+ (handle_braces): Rewrite; handle %{S:X;T:Y;:D} syntax; accept
+ and ignore whitespace in more places.
+ (specs documentation comment): Document %{S:X;T:Y;:D}.
+ Clarify other %{...} docs.
+ * doc/invoke.texi: Document %{S:X;T:Y;:D}. Clarify other
+ %{...} docs.
+
+ * config/arm/aof.h (LINK_SPEC): Change %{ov*,*} to %{ov*}.
+ * config/rs6000/sysv4.h: Use N-way choice spec syntax.
+
2002-09-25 David S. Miller <davem@redhat.com>
PR target/7842
@@ -4476,6 +5616,11 @@ Mon Sep 30 14:57:18 CEST 2002 Jan Hubicka <jh@suse.cz>
* config/mips/mips.h (TARGET_MIPS4100): Add missing bracket.
+2002-09-24 Nathan Sidwell <nathan@codesourcery.com>
+
+ * profile.c (end_branch_prob): Only look for __gcov_init on
+ weak-enabled native compilers.
+
2002-09-24 Denis Chertykov <denisc@overta.ru>
* config/ip2k/ip2k.c (function_epilogue): Fix wrong numbers in
@@ -4548,6 +5693,38 @@ Mon Sep 30 14:57:18 CEST 2002 Jan Hubicka <jh@suse.cz>
* config/stormy16/stormy16.h: Likewise.
* config/vax/vax.h: Likewise.
+2002-09-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/alpha/alpha.h: Remove commented-out macro
+ definitions of HAVE_{POST|PRE}_{INC|DEC}REMENT.
+ * config/avr/avr.h: Likewise.
+ * config/d30v/d30v.h: Likewise.
+ * config/dsp16xx/dsp16xx.h: Likewise.
+ * config/i370/i370.h: Likewise.
+ * config/i386/i386.h: Likewise.
+ * config/i960/i960.h: Likewise.
+ * config/m68k/m68k.h: Likewise.
+ * config/m88k/m88k.h: Likewise.
+ * config/mips/mips.h: Likewise.
+ * config/ns32k/ns32k.h: Likewise.
+ * config/pdp11/pdp11.h: Likewise.
+ * config/romp/romp.h: Likewise.
+ * config/rs6000/rs6000.h: Likewise.
+ * config/s390/s390.h: Likewise.
+ * config/sh/sh.h: Likewise.
+ * config/sparc/sparc.h: Likewise.
+ * config/stormy16/stormy16.h: Likewise.
+ * config/vax/vax.h: Likewise.
+
+2002-09-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * function.c (push_temp_slots_for_block): Remove.
+ (push_temp_slots_for_target): Likewise.
+ (get_target_temp_slot_level): Likewise.
+ (set_target_temp_slot_level): Likewise.
+ (get_first_block_beg): Likewise.
+ * function.h: Remove corresponding prototypes.
+
2002-09-23 Zack Weinberg <zack@codesourcery.com>
* version.c (version_string): Now const char[].
@@ -4611,6 +5788,13 @@ Mon Sep 30 14:57:18 CEST 2002 Jan Hubicka <jh@suse.cz>
* doc/invoke.texi (-fabi-version): Document it.
(-Wabi): Add information about bit-fields in unions.
+2002-09-22 Roger Sayle <roger@eyesopen.com>
+
+ * expr.c (STORE_BY_PIECES_P): New target macro.
+ (can_store_by_pieces, store_by_pieces): Use STORE_BY_PIECES_P
+ instead of MOVE_BY_PIECES_P.
+ * doc/tm.texi: Document this new macro.
+
2002-09-22 Jason Thorpe <thorpej@wasabisystems.com>
* config/mips/netbsd.h (SUBTARGET_ASM_SPEC): Always pass -KPIC
@@ -5004,6 +6188,53 @@ Tue Aug 27 20:07:01 CEST 2002 Jan Hubicka <jh@suse.cz>
* combine.c (make_extraction): Don't create
invalid subreg.
+2002-09-19 Roger Sayle <roger@eyesopen.com>
+
+ * tree.c (integer_nonzerop): New predicate for nonzero integers.
+ * tree.h (integer_nonzerop): Add function prototype.
+ * stmt.c (expand_end_loop): Don't rotate the loop when there
+ are no instructions in the test, i.e. the loop is unconditional.
+ (expand_exit_loop_if_false): Optimize RTL generation of loop
+ tests when the condition is always true or always false.
+ * c-semantics.c (genrtl_do_stmt): Optimize RTL generation of
+ do-loops when the condition is always true.
+ (genrtl_for_stmt): Optimize RTL generation of for-loops when
+ the for-expression is empty.
+
+2002-09-19 Zack Weinberg <zack@codesourcery.com>
+
+ * gcc.c (use_pipes): New flag.
+ (process_command): Set it. Adjust check for -pipe conflicting
+ with -time or -save-temps.
+ (do_spec_1): Use it. Handle %|SUFFIX, %mSUFFIX, and
+ %<SWITCH. Drop %| (without a SUFFIX).
+ (handle_braces): Drop %{<SWITCH}, %{^SWITCH}, %{|...}.
+ (give_switch): Third argument eliminated.
+ (invoke_as, @assembler_with_cpp spec): Use %|.s or %m.s
+ depending on AS_NEEDS_DASH_FOR_PIPED_INPUT.
+ (specs documentation comment): Update.
+
+ * config/netbsd-aout.h, config/openbsd.h, config/ptx4.h,
+ config/svr4.h, config/i386/freebsd-aout.h,
+ config/m68k/netbsd-elf.h, config/m68k/netbsd.h,
+ config/m68k/openbsd.h, config/mips/openbsd.h,
+ config/sparc/sparc.h: Define AS_NEEDS_DASH_FOR_PIPED_INPUT
+ instead of putting %| into ASM_SPEC and/or ASM_FINAL_SPEC.
+ * config/avr/avr.h: Delete do-nothing ASM_FINAL_SPEC.
+ * config/cris/cris.h: Update comment.
+
+ * ada/lang-specs.h: Use %(invoke_as). Straighten out
+ error messages. Don't use %{^SWITCH}.
+ * ada/misc.c (gnat_decode_option): Handle -I with a
+ separate argument.
+
+ * f/lang-specs.h: Use %| and %m.
+ * java/jvspec.c: Use %m and %(invoke_as). Change all
+ uses of %{<SWITCH} to %<SWITCH.
+
+ * doc/invoke.texi: Update documentation of specs.
+ * doc/tm.texi: Document AS_NEEDS_DASH_FOR_PIPED_INPUT.
+
2002-09-19 Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/s390.c (addr_generation_dependency_p): Handle SUBREG
@@ -5014,6 +6245,22 @@ Tue Aug 27 20:07:01 CEST 2002 Jan Hubicka <jh@suse.cz>
"*zero_extendqihi2_31"): New insns.
("*zero_extendqihi2_64"): Do not clobber CC.
+2002-09-18 Devang Patel <dpatel@apple.com>
+
+ * cp/cp-tree.h: New prototype for walk_vtables().
+ * cp/decl.c (walk_vtables_r): New function.
+ (struct cp_binding_level): Add new members, namespaces,
+ names_size and vtables.
+ (add_decl_to_level): Add decl in namespaces or vtables
+ chain, if conditions match.
+ (walk_vtables): New function.
+ (walk_namespaces_r): Travers separate namespace chain
+ for namespace decls.
+ (wrapup_globals_for_namespace): Use names_size instead
+ of list_length().
+ * cp/decl2.c (finish_file): Use walk_vtables() instead of
+ walk_globals() to walk vtable decls.
+
2002-09-19 Steve Ellcey <sje@cup.hp.com>
* config/ia64/hpux.h (CTORS_SECTION_ASM_OP): New.
@@ -5111,7 +6358,7 @@ Tue Aug 27 20:07:01 CEST 2002 Jan Hubicka <jh@suse.cz>
remaining_in_alignment.
* doc/tm.texi: (TARGET_MS_BITFIELD_LAYOUT_P): Update.
- (pragma pack): Add paragraph on MSVC bit-field packing.
+ (pragma pack): Add paragraph on MSVC bitfield packing.
2002-09-18 Richard Earnshaw (reanrsha@arm.com)
@@ -5141,6 +6388,17 @@ Tue Aug 27 20:07:01 CEST 2002 Jan Hubicka <jh@suse.cz>
* config/rs60000/rs6000.c (SPE_VECTOR_MODE): Include V1DImode.
* config/rs6000/spe.md (movv1di, movv1di_internal): New patterns.
+2002-09-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * function.c (max_parm_reg_num): Remove.
+ * stmt.c (in_control_zone_p, stmt_loop_nest_empty,
+ drop_through_at_end_p, move_cleanups_up,
+ expand_end_case_dummy, case_index_expr_type): Likewise.
+ * stor-layout.c (pos_from_byte): Likewise.
+ * tree.c (chain_member_value, chain_member_purpose, listify,
+ tree_int_cst_msb, index_type_equal): Likewise.
+ * tree.h: Remove prototypes for unused functions.
+
2002-09-17 Zack Weinberg <zack@codesourcery.com>
* ABOUT-GCC-NLS: Remove reference to enquire, and out-of-date
@@ -5223,6 +6481,36 @@ Tue Sep 17 13:40:13 2002 Nicola Pero <n.pero@mi.flashnet.it>
* cfgrtl.c (flow_delete_block_noexpunge): Delete orphaned
NOTE_INSN_LOOP_CONT notes when deleting basic blocks.
+2002-09-16 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * config/mips/mips.c (save_restore_insns): Remove unused variable.
+ * gcc.c (make_relative_prefix): Likewise.
+ * loop.c (check_final_value): Likewise.
+ * jump.c (init_label_info): Remove return value.
+ * cse.c (prev_insn): Move variable between #ifdef HAVE_cc0 ... #endif.
+
+2002-09-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * dsp16xx.h (ASM_FORMAT_PRIVATE_NAME): Delete.
+ (ASM_PN_FORMAT): Define.
+
+2002-09-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * alpha.h, alpha/vms.h, arc.h, arm/aof.h, arm/aout.h, avr.h,
+ c4x.h, cris.h, d30v.h, fr30.h, frv.h, h8300.h, i370.h, i386.h,
+ i960.h, ia64.h, ip2k.h, m32r.h, m68hc11.h, m68k/3b1.h,
+ m68k/hp320.h, m68k.h, m68k/mot3300.h, m68k/sgs.h, m68k/tower-as.h,
+ m88k.h, mcore.h, mips.h, mmix.h, mn10200.h, mn10300.h, ns32k.h,
+ pa.h, pdp11.h, romp.h, rs6000.h, s390/linux.h, sh.h, sparc.h,
+ stormy16.h, v850.h, vax.h, xtensa.h (ASM_FORMAT_PRIVATE_NAME):
+ Delete.
+ * alpha/vms.h, h8300.h, i370.h, ia64.h, m68k/3b1.h, m68k/hp320.h,
+ m68k/mot3300.h, m68k/sgs.h, m68k/tower-as.h, mmix.h, mn10200.h,
+ mn10300.h, pa.h, v850.h (ASM_PN_FORMAT): Define.
+
+ * defaults.h (ASM_PN_FORMAT, ASM_FORMAT_PRIVATE_NAME): Define.
+ * doc/tm.texi (ASM_FORMAT_PRIVATE_NAME): Update documentation.
+
2002-09-16 Richard Henderson <rth@redhat.com>
* expr.c (emit_block_move): Set memory block size as appropriate
@@ -5518,6 +6806,11 @@ Tue Sep 17 13:40:13 2002 Nicola Pero <n.pero@mi.flashnet.it>
* reload.h: Likewise.
* ssa.c: Likewise.
+2002-09-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (vmsdbgout.o): Depend on $(TARGET_H)
+ * vmsdbgout.c: Include "target.h".
+
2002-09-15 Kazu Hirata <kazu@cs.umass.edu>
* ChangeLog: Follow spelling conventions.
@@ -5645,6 +6938,23 @@ Tue Sep 17 13:40:13 2002 Nicola Pero <n.pero@mi.flashnet.it>
* config/sparc/vxsim.h: Likewise.
* config/sparc/vxsparc64.h: Likewise.
+2002-09-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * c-lex.c (cb_ident): Mark variable with ATTRIBUTE_UNUSED.
+ * collect2.c (ignore_library, aix_std_libs): Move into the context
+ where it is used.
+ * m68hc11.c (m68hc11_autoinc_compatible_p): Delete prototype.
+ (autoinc_mode, m68hc11_make_autoinc_notes): Add prototypes.
+ * m88k.c (output_call): Wrap variables with macro controlling use.
+ * rs6000.md: Likewise. Const-ify variable.
+ * sh.h (ASM_OUTPUT_LABELREF): Likewise.
+ * final.c (only_leaf_regs_used): Likewise.
+ * regrename.c (maybe_mode_change): Mark parameter with
+ ATTRIBUTE_UNUSED.
+ * reload.c (find_valid_class): Likewise. Likewise for variable.
+ (find_reloads_address_1): Likewise.
+ * varasm.c (weak_finish): Wrap variable with macro controlling use.
+
2002-09-14 Marek Michalkiewicz <marekm@amelek.gda.pl>
* config/avr/avr.c (output.h): Move after inclusion of tree.h.
@@ -5731,6 +7041,13 @@ Tue Sep 17 13:40:13 2002 Nicola Pero <n.pero@mi.flashnet.it>
* gcc/config/avr/avr.h: Set default options for C++ for avr.
+2002-09-13 Roger Sayle <roger@eyesopen.com>
+
+ * stmt.c (struct nexting): Remove unused alt_end_label field.
+ (expand_start_loop): Delete initialization of alt_end_label.
+ (expand_start_null_loop): Likewise.
+ (expand_exit_loop_if_false): Delete updating of alt_end_label.
+
2002-09-13 Richard Henderson <rth@redhat.com>
* Makefile.in (toplev.o): Depend on real.h.
@@ -5930,6 +7247,70 @@ Tue Sep 17 13:40:13 2002 Nicola Pero <n.pero@mi.flashnet.it>
("doolop_si", "*doloop_si_long", "doloop_di", "*doloop_di_long",
associated splitters): New.
+2002-09-11 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * genattrtab.c (simplify_cond): Remove unused variable(s).
+ * global.c (record_conflicts): Likewise.
+ * jump.c (rebuild_jump_labels): Likewise.
+ * loop.c (scan_loop, check_final_value): Likewise.
+ * ra-colorize.c (colorize_one_web, assign_colors): Likewise.
+ * reload1.c (eliminate_regs_in_insn, do_input_reload): Likewise.
+ * rtlanal.c (reg_set_p): Likewise.
+ * stmt.c (expand_asm_operands, expand_decl): Likewise.
+ * genautomata.c (empty_reserv): Remove.
+ * loop.c (max_luid): Likewise.
+ * sched-rgn.c (bitlst_table_size): Likewise.
+
+2002-09-11 Nathan Sidwell <nathan@codesourcery.com>
+
+ Reimplement gcov format.
+ * gcov-io.h: Replace.
+ * gcov.c: Reimplement.
+ * gcov-iov.c: New file.
+ * gcov-dump.c: New file.
+ * libgcc2.c (L_bb): Replace with ...
+ (L_gcov): ... this.
+ (struct bb_function_info, struct bb): Remove.
+ (inhibit_libc): Never inhibit.
+ (gcov_list, gcov_crc): New static variables.
+ (gcov_version_mismatch): New static function.
+ (__bb_exit_func): Renamed to ...
+ (__gcov_exit): ... here. Made static. Reimplement.
+ (__gcov_init_func): Rename to ...
+ (__gcov_init): ... here. Check version, update crc.
+ (__bb_fork_func): Rename to ...
+ (__gcov_flush): ... here.
+ * libgcc2.h (struct bb, __bb_exit_func, __bb_init_func,
+ __bb_fork_func, gcov_type, __bb_find_arc_counters): Remove.
+ * calls.c (expand_call): Call __gcov_flush.
+ * profile.c (bb_file, last_bb_file_name): Remove.
+ (bbg_file_name): New global variable.
+ (output_gcov_string): Remove.
+ (get_exec_counts): Reimplement.
+ (branch_prob): Reimplement gcov file writing.
+ (init_branch_prob): Create bbg_file_name, don't create
+ bb_file_name.
+ (end_branch_prob): Adjust. Don't remove counter file when
+ instrumenting ourselves.
+ (create_profiler): Adjust.
+ * doc/gcov.texi (Gcov Data Files): Remove detailed specification,
+ point to gcov-io.h.
+ * Makefile.in (LANGUAGES): Add gcov-dump.
+ (coverageexts): Remove .bb.
+ (STAGESTUFF): Add gcov-dump.
+ (LIB2FUNCS_ST): Replace _bb with _gcov.
+ (profile.o): Depend on gcov-iov.h.
+ (final.o): Don't depend on profile.h, gcov.h.
+ (gcov.o): Depend on gcov-iov.h.
+ (gcov-iov.o): New target.
+ (gcov-iov): New target.
+ (gcov-iov.h): New target.
+ (gcov-dump.o): New target.
+ (GCOV_DUMP_OBJS): New variable.
+ (gcov-dump): New target.
+ (distclean): Remove coverageexts.
+ (stage1): Remove coverageexts.
+
2002-09-11 Hartmut Penner <hpenner@de.ibm.com>
* fold-const.c (make_range): Only narrow to signed range if
@@ -6008,6 +7389,12 @@ Tue Sep 17 13:40:13 2002 Nicola Pero <n.pero@mi.flashnet.it>
* sysv4.h (TARGET_SECTION_TYPE_FLAGS): Define.
* xcoff.h (TARGET_SECTION_TYPE_FLAGS): Define.
+2002-09-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * h8300.md: Fix signed/unsigned warnings.
+ * mcore.md: Likewise.
+ * mn10300.c (mask_ok_for_mem_btst): Likewise.
+
2002-09-09 Per Bothner <per@bothner.com>
* print-tree.c (print_node): In a STRING_CST, escape non-ascii
@@ -6084,6 +7471,34 @@ Tue Sep 17 13:40:13 2002 Nicola Pero <n.pero@mi.flashnet.it>
(function_ok_for_sibcall): Use binds_local_p. Respect longcall
attributes.
+2002-09-08 Nathan Sidwell <nathan@codesourcery.com>
+
+ * basic_block.h (gcov_type): Explain why it is signed.
+ * final.c: Don't include profile.h.
+ (struct function_list, functions_head, functions_tail,
+ end_final): Moved to profile.c
+ (final): Move arc chaining code to profile.c.
+ * function.c (prepare_function_start): Remove duplicate line.
+ * output.h (end_final): Remove prototype.
+ * predict.c (estimate_loops_at_level): Use gcov_type.
+ * profile.c (struct function_list, functions_head,
+ functions_tail): Moved from final.c
+ (need_func_profiler): Remove.
+ (instrument_edges): Don't set need_func_profiler.
+ (get_exec_counts): Avoid signed/unsigned warning.
+ (compute_checksum): Use crc32.
+ (branch_prob): Adjust. Chain onto functions_head.
+ (init_branch_prob): Absorb init_edge_profiler.
+ (init_edge_profiler): Remove.
+ (create_profiler): Moved and renamed from final.c:end_final.
+ Emit data and constructor.
+ (output_func_start_profiler): Remove.
+ * profile.h (struct profile_info): checksum is unsigned.
+ * rtl.h (output_func_start_profiler): Remove prototype.
+ (create_profiler): Declare.
+ * toplev.c (compile_file): Call create_profiler, if instrumenting
+ arcs. Don't call end_final.
+
2002-09-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* fr30.c (fr30_print_operand): Fix bug in output of CONST_DOUBLE.
@@ -6181,6 +7596,10 @@ Tue Sep 17 13:40:13 2002 Nicola Pero <n.pero@mi.flashnet.it>
* config/h8300/h8300.md (udivmodqi4): Enable on H8/300.
(anonymous pattern): Likewise.
+2002-09-07 Igor Shevlyakov <igor@microunity.com>
+
+ * machmode.def: Add modes for half-float vectors.
+
2002-09-07 Scott Snyder <snyder@fnal.gov>
PR target/7374
@@ -6412,6 +7831,32 @@ Thu Sep 5 16:27:47 2002 J"orn Rennecke <joern.rennecke@superh.com>
* config/h8300/h8300.c (asm_file_start): Add a missing
semicolon.
+2002-09-04 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * c-typeck.c (build_function_call): Remove unused variable(s).
+ (build_c_cast): Likewise.
+ * calls.c (rtx_for_function_call): Likewise.
+ * cfglayout.c (duplicate_insn_chain): Likewise.
+ * cfgloop.c (flow_loop_nodes_find): Likewise.
+ * cfgrtl.c (split_edge): Likewise.
+ * df.c (df_ref_create): Likewise.
+ * except.c (expand_end_catch): Likewise.
+ * expr.c (emit_push_insn, store_constructor, expand_expr): Likewise.
+ * function.c (emit_return_into_block): Likewise.
+ (reposition_prologue_and_epilogue_notes): Likewise.
+ * gengtype.c (get_file_basename, write_gc_structure_fields): Likewise.
+ * combine.c (subst_prev_insn, need_refresh): Remove.
+ * dwarf2out.c (primary_filename): Remove.
+ * final.c (new_block): Remove.
+ * gcse.c (orig_bb_count): Remove.
+
+2002-09-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * dsp16xx-protos.h (dsp16xx_compare_gen): Change to bool.
+ * dsp16xx.c (dsp16xx_compare_gen): Likewise.
+ * dsp16xx.md: Treat dsp16xx_compare_gen as a bool. Call functions
+ directly instead of using a function pointer.
+
2002-09-04 Krister Walfridsson <cato@df.lth.se>
* config/i386/i386.h (GOT_SYMBOL_NAME): Define.
@@ -6605,6 +8050,25 @@ Wed Sep 4 11:22:14 2002 J"orn Rennecke <joern.rennecke@superh.com>
* sh.md (mperm_w_little, mperm_w_big): Supply mode for zero_extract.
+2002-09-03 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (build_function_call_expr): Remove prototype, export
+ as non-static and add a comment above function definition.
+ (builtin_mathfn_code): New function to check for math builtins.
+ (fold_builtin): Optimize sqrt(0.0) as 0.0, sqrt(1.0) as 1.0,
+ exp(0.0) as 1.0, and log(1.0) as 0.0. Optimize exp(log(x)) and
+ log(exp(x)) as x. Optimize sqrt(exp(x)) as exp(x/2.0) and
+ log(sqrt(x)) as log(x)/2.0.
+
+ * tree.h: Prototype build_function_call_expr and builtin_mathfn_code
+ in new "builtins.c" section. Place the build_range_type prototype
+ with the other prototypes from "tree.c".
+
+ * fold-const.c (fold) [ABS_EXPR]: Fold fabs(sqrt(x)) as sqrt(x)
+ and fabs(exp(x)) as exp(x). [MULT_EXPR]: Fold sqrt(x)*sqrt(y)
+ as sqrt(x*y) and exp(x)*exp(y) as exp(x+y). [RDIV_EXPR]: Fold
+ x/exp(y) as x*exp(-y).
+
2002-09-03 David Edelsohn <edelsohn@gnu.org>
* varasm.c (default_section_type_flags): Append _1 to name with
@@ -6752,6 +8216,119 @@ Tue Sep 3 11:32:14 2002 Nicola Pero <n.pero@mi.flashnet.it>
* expr.c (expand_expr): Remove extraneous comment and code.
+2002-09-02 Nathan Sidwell <nathan@codesourcery.com>
+
+ * stor-layout (finish_builtin_struct): Renamed and moved from c++
+ frontend. Take chain of fields. Allow NULL alignment type.
+ * tree.h (finish_builtin_struct): Declare.
+
+2002-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * config/alpha/alpha.c config/alpha/alpha.h config/alpha/alpha.md
+ config/alpha/elf.h config/alpha/unicosmk.h config/alpha/vms.h
+ config/arc/arc.c config/arc/arc.h config/arm/aout.h
+ config/arm/arm.c config/arm/arm.h config/arm/arm.md
+ config/avr/avr.h config/d30v/d30v.h config/dbxcoff.h
+ config/dbxelf.h config/elfos.h config/fr30/fr30.h config/frv/frv.h
+ config/i386/i386.c config/i386/i386.md config/i386/sco5.h
+ config/ia64/ia64.h config/ip2k/ip2k.h config/m68hc11/m68hc11.md
+ config/m68k/hp320.h config/m68k/m68k.c config/m68k/m68k.md
+ config/m68k/mot3300.h config/m68k/sgs.h config/m68k/tower-as.h
+ config/m88k/m88k.c config/m88k/m88k.h config/mcore/mcore-pe.h
+ config/mcore/mcore.c config/mips/mips.c config/mips/mips.h
+ config/ns32k/ns32k.md config/pa/pa-linux.h config/pa/pa.c
+ config/pa/pa.h config/pa/pa.md config/romp/romp.h
+ config/rs6000/linux64.h config/rs6000/lynx.h
+ config/rs6000/rs6000.c config/rs6000/sysv4.h config/rs6000/xcoff.h
+ config/s390/s390.c config/s390/s390.md config/sh/sh.c
+ config/sparc/sparc.c config/sparc/sysv4.h
+ config/stormy16/stormy16.h dbxout.c defaults.h dwarf2out.c
+ dwarfout.c except.c final.c varasm.c vmsdbgout.c: Replace
+ ASM_OUTPUT_INTERNAL_LABEL macro with a call to the target hook.
+
+ * doc/tm.texi: Update docs.
+ * default.h (ASM_OUTPUT_INTERNAL_LABEL): Don't define.
+ * system.h (ASM_OUTPUT_INTERNAL_LABEL): Poison.
+
+2002-08-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (sdbout.o, insn-output.o): Depend on $(TARGET_H).
+ * arc.c (arc_internal_label): New function.
+ (TARGET_ASM_INTERNAL_LABEL): Set.
+ * arc.h (ASM_OUTPUT_INTERNAL_LABEL): Delete.
+ * arm.c (arm_internal_label): New function.
+ (TARGET_ASM_INTERNAL_LABEL): Set.
+ * arm.h (ASM_OUTPUT_INTERNAL_LABEL): Delete.
+ * arm/elf.h (ASM_OUTPUT_INTERNAL_LABEL): Delete.
+ * i370.c (i370_internal_label): New function.
+ (TARGET_ASM_INTERNAL_LABEL): Set.
+ * i370.h (ASM_OUTPUT_INTERNAL_LABEL): Delete.
+ * m68k/hp320.h (ASM_OUTPUT_INTERNAL_LABEL): Delete.
+ * m68k.c (m68k_hp320_internal_label): New function.
+ (TARGET_ASM_INTERNAL_LABEL): Set.
+ * m88k.c (m88k_internal_label): New function.
+ (TARGET_ASM_INTERNAL_LABEL): Set.
+ * m88k.h (ASM_OUTPUT_INTERNAL_LABEL): Delete.
+ * defaults.h (ASM_OUTPUT_INTERNAL_LABEL): Set to target hook.
+ * genoutput.c (output_prologue): Include target.h in output file.
+ * output.h (default_internal_label): Declare.
+ * sdbout.c: Include target.h.
+ * target-def.h (TARGET_ASM_INTERNAL_LABEL): Set and add to
+ TARGET_ASM_OUT.
+ * target.h (internal_label): Add to struct gcc_target.
+ * varasm.c (default_internal_label): New function.
+
+2002-08-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * alpha.h (ASM_OUTPUT_INTERNAL_LABEL): Delete.
+ * avr.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * c4x.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * cris.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * d30v.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * darwin.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * dsp16xx.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * elfos.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * h8300.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * i386/att.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * i386/bsd.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * i386/i386-coff.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * i386/lynx-ng.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * i386/lynx.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * i386/sco5.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * i960/i960.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * m68k/3b1.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * m68k/amix.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * m68k/atari.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * m68k.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * m68k/mot3300.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * m68k/tower-as.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * m88k.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * mcore.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * mips.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * mmix-protos.h (mmix_asm_output_internal_label): Likewise.
+ * mmix.c (mmix_asm_output_internal_label): Likewise.
+ * mmix.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * ns32k.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * pa.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * pdp11.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * romp.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * rs6000/xcoff.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * sh/coff.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * sh/elf.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * sparc/freebsd.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * sparc/linux.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * sparc/linux64.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * sparc/netbsd-elf.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * sparc/pbd.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * sparc/sol2.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * sparc.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * sparc/vxsim.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * stormy16.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * svr3.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ * vax.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+
+ * defaults.h (ASM_OUTPUT_INTERNAL_LABEL): Define.
+
2002-08-31 Richard Henderson <rth@redhat.com>
* expr.c (block_move_libcall_safe_for_call_parm): Fix thinko.
@@ -6989,6 +8566,11 @@ Fri Aug 30 00:33:37 2002 Nicola Pero <n.pero@mi.flashnet.it>
code if operand0 and operand5 are the same.
* config/v850/v850-protos.h: Prototype new predicates.
+2002-08-29 Zack Weinberg <zack@codesourcery.com>
+
+ * config/rs6000/rs6000.c (processor_target_table): Add 405f.
+ * config/rs6000/rs6000.h (ASM_CPU_SPEC): Likewise.
+
2002-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
* c-common.c (builtin_define_type_precision): New function.
@@ -10966,7 +12548,7 @@ Tue Jul 16 19:32:58 2002 J"orn Rennecke <joern.rennecke@superh.com>
(TARGET_SWITCHES): Add -mieee-compare option.
(OVERRIDE_OPTIONS): 32332 is a subset of
32532. Don't use IEEE_COMPARE -funsafe-math-optimizations.
- (TARGET_SWITCHES): Fix description of bit-field option.
+ (TARGET_SWITCHES): Fix description of bitfield option.
* config/ns32k/netbsd.h (TARGET_DEFAULT): Add
-mieee-compare option. Remove 32332 flag.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index e1fb947e4ed..29e5101c04c 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -47,7 +47,7 @@ SUBDIRS =@subdirs@
# Selection of languages to be made.
# This is overridden by configure.
CONFIG_LANGUAGES = @all_languages@
-LANGUAGES = c gcov$(exeext) $(CONFIG_LANGUAGES)
+LANGUAGES = c gcov$(exeext) gcov-dump$(exeext) $(CONFIG_LANGUAGES)
# Selection of languages to be made during stage1 build.
# This is overridden by configure.
@@ -74,7 +74,7 @@ BOOT_CFLAGS = -g -O2
# without optimization. The -dumpbase $@ makes sure that the auxilary
# files end up near the object files.
COVERAGE_FLAGS = @coverage_flags@
-coverageexts = .{da,bb,bbg}
+coverageexts = .{da,bbg}
# The warning flags are separate from BOOT_CFLAGS because people tend to
# override optimization flags and we'd like them to still have warnings
@@ -186,7 +186,7 @@ USER_H = $(srcdir)/ginclude/float.h \
# The GCC to use for compiling libgcc.a and crt*.o.
# Usually the one we just built.
# Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
-GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include
+GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -L$(objdir)/../ld
# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
# It omits XCFLAGS, and specifies -B./.
@@ -258,7 +258,7 @@ FIBHEAP_H = $(srcdir)/../include/fibheap.h
# Default native SYSTEM_HEADER_DIR, to be overridden by targets.
NATIVE_SYSTEM_HEADER_DIR = /usr/include
# Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
-CROSS_SYSTEM_HEADER_DIR = $(build_tooldir)/sys-include
+CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
# autoconf sets SYSTEM_HEADER_DIR to one of the above.
SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@
@@ -270,6 +270,10 @@ STMP_FIXINC = @STMP_FIXINC@
# Test to see whether <limits.h> exists in the system header files.
LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
+# Directory for prefix to system directories, for
+# each of $(system_prefix)/usr/include, $(system_prefix)/usr/lib, etc.
+TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
+
target=@target@
target_alias=@target_alias@
xmake_file=@dep_host_xmake_file@
@@ -277,6 +281,8 @@ tmake_file=@dep_tmake_file@
out_file=$(srcdir)/config/@out_file@
out_object_file=@out_object_file@
md_file=$(srcdir)/config/@md_file@
+tm_file=@tm_file@
+tm_file_list=@tm_file_list@
tm_defines=@tm_defines@
tm_p_file_list=@tm_p_file_list@
tm_p_file=@tm_p_file@
@@ -397,7 +403,7 @@ CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
-finhibit-size-directive -fno-inline-functions -fno-exceptions \
-fno-zero-initialized-in-bss
-# Additional sources to handle exceptions; overridden on ia64.
+# Additional sources to handle exceptions; overridden by targets as needed.
LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
$(srcdir)/unwind-sjlj.c
LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
@@ -486,12 +492,12 @@ BUILD_PREFIX = @BUILD_PREFIX@
# out of the way of the other rules for compiling the same source files.
BUILD_PREFIX_1 = @BUILD_PREFIX_1@
# Native compiler for the build machine and its switches.
-HOST_CC = @HOST_CC@
-HOST_CFLAGS= @HOST_CFLAGS@ -DGENERATOR_FILE
+BUILD_CC = @BUILD_CC@
+BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE
# Native linker and preprocessor flags. For x-fragment overrides.
-HOST_LDFLAGS=$(LDFLAGS)
-HOST_CPPFLAGS=$(ALL_CPPFLAGS)
+BUILD_LDFLAGS=$(LDFLAGS)
+BUILD_CPPFLAGS=$(ALL_CPPFLAGS)
# Actual name to use when installing a native compiler.
GCC_INSTALL_NAME = `echo gcc|sed '$(program_transform_name)'`
@@ -550,19 +556,20 @@ all: all.indirect
# This tells GNU Make version 3 not to put all variables in the environment.
.NOEXPORT:
-# GCONFIG_H lists the config files that the generator files depend on, while
-# CONFIG_H lists the ones ordinary gcc files depend on, which includes
-# several files generated by those generators.
-GCONFIG_H = config.h $(host_xm_file_list)
-HCONFIG_H = hconfig.h $(build_xm_file_list)
-CONFIG_H = $(GCONFIG_H) insn-constants.h insn-flags.h
+# GTM_H lists the config files that the generator files depend on,
+# while TM_H lists the ones ordinary gcc files depend on, which
+# includes several files generated by those generators.
+BCONFIG_H = bconfig.h $(build_xm_file_list)
+CONFIG_H = config.h $(host_xm_file_list)
TCONFIG_H = tconfig.h $(xm_file_list)
+TM_P_H = tm_p.h $(tm_p_file_list)
+GTM_H = tm.h $(tm_file_list)
+TM_H = $(GTM_H) insn-constants.h insn-flags.h
+
TARGET_H = target.h
HOOKS_H = hooks.h
LANGHOOKS_DEF_H = langhooks-def.h $(HOOKS_H)
TARGET_DEF_H = target-def.h $(HOOKS_H)
-TM_P_H = tm_p.h $(tm_p_file_list) tm-preds.h
-
MACHMODE_H = machmode.h machmode.def @extra_modes_file@
RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H)
RTL_H = $(RTL_BASE_H) genrtl.h
@@ -605,7 +612,7 @@ INTERNAL_CFLAGS = -DIN_GCC @CROSS@
# This is the variable actually used when we compile.
# If you change this line, you probably also need to change the definition
-# of HOST_CFLAGS in build-make to match.
+# of BUILD_CFLAGS in build-make to match.
ALL_CFLAGS = $(X_CFLAGS) $(T_CFLAGS) \
$(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) $(XCFLAGS) @DEFS@
@@ -622,7 +629,7 @@ LIBDEPS= $(INTLDEPS) $(LIBIBERTY)
# Likewise, for use in the tools that must run on this machine
# even if we are cross-building GCC.
-HOST_LIBDEPS= $(BUILD_LIBIBERTY)
+BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
# How to link with both our special library facilities
# and the system's installed libraries.
@@ -633,16 +640,16 @@ SYSLIBS = @GNAT_LIBEXC@
# Likewise, for use in the tools that must run on this machine
# even if we are cross-building GCC.
-HOST_LIBS = $(BUILD_LIBIBERTY)
+BUILD_LIBS = $(BUILD_LIBIBERTY)
-HOST_RTL = $(BUILD_PREFIX)rtl.o read-rtl.o $(BUILD_PREFIX)bitmap.o \
+BUILD_RTL = $(BUILD_PREFIX)rtl.o read-rtl.o $(BUILD_PREFIX)bitmap.o \
$(BUILD_PREFIX)ggc-none.o
-HOST_SUPPORT = gensupport.o insn-conditions.o
-HOST_EARLY_SUPPORT = gensupport.o dummy-conditions.o
+BUILD_SUPPORT = gensupport.o insn-conditions.o
+BUILD_EARLY_SUPPORT = gensupport.o dummy-conditions.o
-HOST_PRINT = print-rtl1.o
-HOST_ERRORS = $(BUILD_PREFIX)errors.o
-HOST_VARRAY = $(BUILD_PREFIX)varray.o
+BUILD_PRINT = print-rtl1.o
+BUILD_ERRORS = $(BUILD_PREFIX)errors.o
+BUILD_VARRAY = $(BUILD_PREFIX)varray.o
# Specify the directories to be searched for header files.
# Both . and srcdir are used, in that order,
@@ -777,7 +784,8 @@ STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
$(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) cc1obj$(exeext) \
protoize$(exeext) unprotoize$(exeext) \
specs collect2$(exeext) $(USE_COLLECT2) \
- gcov$(exeext) *.[0-9][0-9].* *.[si] libcpp.a libbackend.a libgcc.mk \
+ gcov-iov$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \
+ *.[0-9][0-9].* *.[si] libcpp.a libbackend.a libgcc.mk \
$(LANG_STAGESTUFF)
# Library members defined in libgcc2.c.
@@ -791,7 +799,7 @@ LIB2FUNCS_2 = _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi _floatditf \
_addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors
# Defined in libgcc2.c, included only in the static library.
-LIB2FUNCS_ST = _eprintf _bb __gcc_bcmp
+LIB2FUNCS_ST = _eprintf _gcov __gcc_bcmp
FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
_fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
@@ -850,31 +858,34 @@ Makefile: $(srcdir)/Makefile.in config.status $(srcdir)/version.c \
rm -f config.run
config.h: cs-config.h ; @true
-hconfig.h: cs-hconfig.h ; @true
+bconfig.h: cs-bconfig.h ; @true
tconfig.h: cs-tconfig.h ; @true
+tm.h: cs-tm.h ; @true
tm_p.h: cs-tm_p.h ; @true
cs-config.h: Makefile
- TM_DEFINES="$(tm_defines)" \
- HEADERS="$(host_xm_file)" XM_DEFINES="$(host_xm_defines)" \
- TARGET_CPU_DEFAULT="$(target_cpu_default)" \
+ TARGET_CPU_DEFAULT="" \
+ HEADERS="$(host_xm_file)" DEFINES="$(host_xm_defines)" \
$(SHELL) $(srcdir)/mkconfig.sh config.h
-cs-hconfig.h: Makefile
- TM_DEFINES="$(tm_defines)" \
- HEADERS="$(build_xm_file)" XM_DEFINES="$(build_xm_defines)" \
- TARGET_CPU_DEFAULT="$(target_cpu_default)" \
- $(SHELL) $(srcdir)/mkconfig.sh hconfig.h
+cs-bconfig.h: Makefile
+ TARGET_CPU_DEFAULT="" \
+ HEADERS="$(build_xm_file)" DEFINES="$(build_xm_defines)" \
+ $(SHELL) $(srcdir)/mkconfig.sh bconfig.h
cs-tconfig.h: Makefile
- TM_DEFINES="$(tm_defines)" \
- HEADERS="$(xm_file)" XM_DEFINES="$(xm_defines)" \
TARGET_CPU_DEFAULT="" \
+ HEADERS="$(xm_file)" DEFINES="$(xm_defines)" \
$(SHELL) $(srcdir)/mkconfig.sh tconfig.h
+cs-tm.h: Makefile
+ TARGET_CPU_DEFAULT="$(target_cpu_default)" \
+ HEADERS="$(tm_file)" DEFINES="$(tm_defines)" \
+ $(SHELL) $(srcdir)/mkconfig.sh tm.h
+
cs-tm_p.h: Makefile
- TM_DEFINES="" \
- HEADERS="$(tm_p_file)" XM_DEFINES="" TARGET_CPU_DEFAULT="" \
+ TARGET_CPU_DEFAULT="" \
+ HEADERS="$(tm_p_file)" DEFINES="" \
$(SHELL) $(srcdir)/mkconfig.sh tm_p.h
# Don't automatically run autoconf, since configure.in might be accidentally
@@ -1055,7 +1066,7 @@ libgcc.a: $(LIBGCC_DEPS)
NM_FOR_TARGET="$(NM_FOR_TARGET)" AWK="$(AWK)" \
LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \
INCLUDES="$(INCLUDES)" \
- CONFIG_H="$(TCONFIG_H)" MACHMODE_H="$(MACHMODE_H)" \
+ CONFIG_H="$(TCONFIG_H)" MACHMODE_H="$(MACHMODE_H)" TM_H="$(TM_H)" \
LIB1ASMSRC='$(LIB1ASMSRC)' \
MAKEOVERRIDES= \
-f libgcc.mk all
@@ -1107,33 +1118,33 @@ stmp-multilib: $(LIBGCC_DEPS)
# linked using GCC on systems using COFF or ELF, for the sake of C++
# constructors.
$(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
- gbl-ctors.h stmp-int-hdrs tsystem.h
+ gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
@inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_BEGIN \
-o $(T)crtbegin$(objext)
$(T)crtend.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
- gbl-ctors.h stmp-int-hdrs tsystem.h
+ gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
@inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_END \
-o $(T)crtend$(objext)
# These are versions of crtbegin and crtend for shared libraries.
$(T)crtbeginS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
- gbl-ctors.h stmp-int-hdrs tsystem.h
+ gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
@inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O \
-o $(T)crtbeginS$(objext)
$(T)crtendS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
- gbl-ctors.h stmp-int-hdrs tsystem.h
+ gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
@inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_END -DCRTSTUFFS_O \
-o $(T)crtendS$(objext)
# This is a version of crtbegin for -static links.
$(T)crtbeginT.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
- gbl-ctors.h stmp-int-hdrs tsystem.h
+ gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
@inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O \
-o $(T)crtbeginT$(objext)
@@ -1157,10 +1168,10 @@ s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
# C language specific files.
-c-errors.o: c-errors.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) flags.h \
- diagnostic.h $(TM_P_H)
-c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) $(GGC_H) intl.h \
- $(C_TREE_H) input.h flags.h $(SYSTEM_H) toplev.h output.h $(CPPLIB_H) \
+c-errors.o: c-errors.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ $(C_TREE_H) flags.h diagnostic.h $(TM_P_H)
+c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ $(GGC_H) intl.h $(C_TREE_H) input.h flags.h toplev.h output.h $(CPPLIB_H) \
gt-c-parse.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-c $(srcdir)/c-parse.c $(OUTPUT_OPTION)
@@ -1182,33 +1193,33 @@ $(srcdir)/c-parse.y: c-parse.in
$(srcdir)/c-parse.in >>tmp-c-parse.y
$(SHELL) $(srcdir)/move-if-change tmp-c-parse.y $(srcdir)/c-parse.y
-c-decl.o : c-decl.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) $(C_TREE_H) \
- $(GGC_H) $(TARGET_H) flags.h function.h output.h $(EXPR_H) \
+c-decl.o : c-decl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
+ $(C_TREE_H) $(GGC_H) $(TARGET_H) flags.h function.h output.h $(EXPR_H) \
debug.h toplev.h intl.h $(TM_P_H) tree-inline.h $(TIMEVAR_H) c-pragma.h \
gt-c-decl.h
-c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
+c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \
$(TARGET_H) flags.h intl.h output.h $(EXPR_H) $(RTL_H) toplev.h $(TM_P_H)
-c-lang.o : c-lang.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
+c-lang.o : c-lang.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \
$(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) c-common.h gtype-c.h
-c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) \
+c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
debug.h $(C_TREE_H) c-common.h real.h \
c-pragma.h input.h intl.h flags.h toplev.h output.h \
mbchar.h $(CPPLIB_H) $(EXPR_H) $(TM_P_H)
-c-objc-common.o : c-objc-common.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
+c-objc-common.o : c-objc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(C_TREE_H) $(RTL_H) insn-config.h integrate.h $(EXPR_H) $(C_TREE_H) \
flags.h toplev.h tree-inline.h diagnostic.h integrate.h $(VARRAY_H) \
langhooks.h $(GGC_H) gt-c-objc-common.h $(TARGET_H)
-c-aux-info.o : c-aux-info.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
- flags.h toplev.h
-c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h toplev.h \
- $(C_COMMON_H)
-c-pragma.o: c-pragma.c $(CONFIG_H) $(SYSTEM_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
-mbchar.o: mbchar.c $(CONFIG_H) $(SYSTEM_H) mbchar.h
-graph.o: graph.c $(CONFIG_H) $(SYSTEM_H) toplev.h flags.h output.h $(RTL_H) \
- function.h hard-reg-set.h $(BASIC_BLOCK_H) graph.h
-sbitmap.o: sbitmap.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h hard-reg-set.h \
- $(BASIC_BLOCK_H)
+c-aux-info.o : c-aux-info.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ $(C_TREE_H) flags.h toplev.h
+c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ flags.h toplev.h $(C_COMMON_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
+mbchar.o: mbchar.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) mbchar.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
+sbitmap.o: sbitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
+ hard-reg-set.h $(BASIC_BLOCK_H)
COLLECT2_OBJS = collect2.o tlink.o intl.o version.o
COLLECT2_LIBS = @COLLECT2_LIBS@
@@ -1218,42 +1229,43 @@ collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS)
$(COLLECT2_OBJS) $(LIBS) $(COLLECT2_LIBS)
mv -f T$@ $@
-collect2.o : collect2.c $(CONFIG_H) $(SYSTEM_H) gstab.h intl.h \
+collect2.o : collect2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) gstab.h intl.h \
$(OBSTACK_H) $(DEMANGLE_H) collect2.h version.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DTARGET_MACHINE=\"$(target_alias)\" \
-c $(srcdir)/collect2.c $(OUTPUT_OPTION)
-tlink.o: tlink.c $(DEMANGLE_H) $(HASHTAB_H) $(CONFIG_H) $(SYSTEM_H) \
+tlink.o: tlink.c $(DEMANGLE_H) $(HASHTAB_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(OBSTACK_H) collect2.h intl.h
# A file used by all variants of C.
-c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(OBSTACK_H) \
- $(C_COMMON_H) flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
- $(EXPR_H) $(TM_P_H) builtin-types.def builtin-attrs.def $(TARGET_H) \
+c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ $(OBSTACK_H) $(C_COMMON_H) flags.h toplev.h output.h c-pragma.h $(RTL_H) \
+ $(GGC_H) $(EXPR_H) $(TM_P_H) builtin-types.def builtin-attrs.def $(TARGET_H) \
diagnostic.h except.h gt-c-common.h real.h langhooks.h
c-pretty-print.o : c-pretty-print.c c-pretty-print.h pretty-print.h \
- $(C_COMMON_H) $(CONFIG_H) $(SYSTEM_H) real.h
+ $(C_COMMON_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) real.h
-c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_COMMON_H) \
+c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_COMMON_H) \
c-pragma.h flags.h toplev.h langhooks.h tree-inline.h diagnostic.h \
intl.h
# A file used by all variants of C and some other languages.
-attribs.o : attribs.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h \
+attribs.o : attribs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) flags.h \
toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) $(EXPR_H) $(TM_P_H) \
builtin-types.def $(TARGET_H) langhooks.h
-c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) langhooks.h \
+c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) langhooks.h \
$(C_COMMON_H) flags.h toplev.h intl.h diagnostic.h
-c-semantics.o : c-semantics.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
- flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
+c-semantics.o : c-semantics.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ $(C_TREE_H) flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
$(EXPR_H) $(PREDICT_H)
-c-dump.o : c-dump.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) tree-dump.h
+c-dump.o : c-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ $(C_TREE_H) tree-dump.h
# Language-independent files.
@@ -1264,11 +1276,12 @@ DRIVER_DEFINES = \
-DDEFAULT_TARGET_MACHINE=\"$(target_alias)\" \
-DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
-DTOOLDIR_BASE_PREFIX=\"$(unlibsubdir)/../\" \
+ @TARGET_SYSTEM_ROOT_DEFINE@ \
$(VALGRIND_DRIVER_DEFINES) \
`test "X$${SHLIB_LINK}" = "X" || test "@enable_shared@" != "yes" || echo "-DENABLE_SHARED_LIBGCC"` \
`test "X$${SHLIB_MULTILIB}" = "X" || echo "-DNO_SHARED_LIBGCC_MULTILIB"`
-gcc.o: gcc.c $(CONFIG_H) $(SYSTEM_H) intl.h multilib.h \
+gcc.o: gcc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h multilib.h \
Makefile $(lang_specs_files) specs.h prefix.h $(GCC_H)
(SHLIB_LINK='$(SHLIB_LINK)' \
SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
@@ -1276,14 +1289,14 @@ gcc.o: gcc.c $(CONFIG_H) $(SYSTEM_H) intl.h multilib.h \
$(DRIVER_DEFINES) \
-c $(srcdir)/gcc.c $(OUTPUT_OPTION))
-gccspec.o: gccspec.c $(CONFIG_H) $(SYSTEM_H) $(GCC_H)
+gccspec.o: gccspec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H)
(SHLIB_LINK='$(SHLIB_LINK)' \
SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(DRIVER_DEFINES) \
-c $(srcdir)/gccspec.c $(OUTPUT_OPTION))
-cppspec.o: cppspec.c $(CONFIG_H) $(SYSTEM_H) $(GCC_H)
+cppspec.o: cppspec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H)
tree-check.h: s-check ; @true
s-check : gencheck$(build_exeext) $(srcdir)/move-if-change
@@ -1291,13 +1304,13 @@ s-check : gencheck$(build_exeext) $(srcdir)/move-if-change
$(SHELL) $(srcdir)/move-if-change tmp-check.h tree-check.h
$(STAMP) s-check
-gencheck$(build_exeext) : gencheck.o $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
- gencheck.o $(HOST_LIBS)
+gencheck$(build_exeext) : gencheck.o $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ gencheck.o $(BUILD_LIBS)
-gencheck.o : gencheck.c gencheck.h tree.def $(HCONFIG_H) $(SYSTEM_H) \
- $(lang_tree_files)
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
+gencheck.o : gencheck.c gencheck.h tree.def $(BCONFIG_H) $(SYSTEM_H) \
+ coretypes.h $(GTM_H) $(lang_tree_files)
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
$(srcdir)/gencheck.c $(OUTPUT_OPTION)
gencheck.h : s-gencheck ; @true
@@ -1328,64 +1341,64 @@ dumpvers: dumpvers.c
version.o: version.c version.h
-gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) varray.h $(HASHTAB_H) \
- $(TREE_H) $(RTL_H) function.h insn-config.h $(EXPR_H) $(OPTABS_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
-ggc-common.o: ggc-common.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) \
+ggc-common.o: ggc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
flags.h $(GGC_H) varray.h $(HASHTAB_H) $(TM_P_H) langhooks.h \
$(PARAMS_H)
-ggc-simple.o: ggc-simple.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- $(GGC_H) varray.h $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H)
+ggc-simple.o: ggc-simple.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
+ flags.h $(GGC_H) varray.h $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H)
-ggc-page.o: ggc-page.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- toplev.h $(GGC_H) varray.h $(TIMEVAR_H) $(TM_P_H)
+ggc-page.o: ggc-page.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
+ flags.h toplev.h $(GGC_H) varray.h $(TIMEVAR_H) $(TM_P_H)
-stringpool.o: stringpool.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(OBSTACK_H) \
- flags.h toplev.h $(GGC_H)
+stringpool.o: stringpool.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ $(OBSTACK_H) flags.h toplev.h $(GGC_H)
-hashtable.o: hashtable.c hashtable.h $(CONFIG_H) $(SYSTEM_H) $(OBSTACK_H)
+hashtable.o: hashtable.c hashtable.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(OBSTACK_H)
-line-map.o: line-map.c line-map.h intl.h $(CONFIG_H) $(SYSTEM_H)
+line-map.o: line-map.c line-map.h intl.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
-ggc-none.o: ggc-none.c $(GCONFIG_H) $(SYSTEM_H) $(GGC_H)
+ggc-none.o: ggc-none.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(GGC_H)
$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
-prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) Makefile prefix.h
+prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) Makefile prefix.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DPREFIX=\"$(prefix)\" \
-c $(srcdir)/prefix.c $(OUTPUT_OPTION)
-convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h convert.h \
- toplev.h langhooks.h
+convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) flags.h \
+ convert.h toplev.h langhooks.h
-langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) toplev.h \
+langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) toplev.h \
tree-inline.h $(RTL_H) insn-config.h integrate.h langhooks.h \
$(LANGHOOKS_DEF_H) flags.h
-tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h function.h toplev.h \
- $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h \
+tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) flags.h function.h \
+ toplev.h $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h \
real.h gt-tree.h
-tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
- flags.h langhooks.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
+tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ $(C_TREE_H) flags.h langhooks.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
$(EXPR_H) $(SPLAY_TREE_H) tree-dump.h
-tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) \
- expr.h flags.h params.h input.h insn-config.h $(INTEGRATE_H) \
+tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ $(RTL_H) expr.h flags.h params.h input.h insn-config.h $(INTEGRATE_H) \
$(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) toplev.h langhooks.h \
$(C_COMMON_H) tree-inline.h
-print-tree.o : print-tree.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(GGC_H) \
- langhooks.h real.h
-stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h \
- function.h $(EXPR_H) $(RTL_H) toplev.h $(GGC_H) $(TM_P_H) $(TARGET_H) \
+print-tree.o : print-tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ $(GGC_H) langhooks.h real.h
+stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ flags.h function.h $(EXPR_H) $(RTL_H) toplev.h $(GGC_H) $(TM_P_H) $(TARGET_H) \
langhooks.h
-fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h real.h \
- toplev.h $(HASHTAB_H) $(EXPR_H) $(RTL_H) $(GGC_H) $(TM_P_H) langhooks.h
+fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ flags.h real.h toplev.h $(HASHTAB_H) $(EXPR_H) $(RTL_H) $(GGC_H) $(TM_P_H) langhooks.h
diagnostic.o : diagnostic.c diagnostic.h real.h diagnostic.def \
- $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TM_P_H) flags.h $(GGC_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)
-toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) function.h \
- flags.h xcoffout.h input.h $(INSN_ATTR_H) output.h diagnostic.h \
+toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
+ function.h flags.h xcoffout.h input.h $(INSN_ATTR_H) output.h diagnostic.h \
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) $(lang_options_files) \
@@ -1394,260 +1407,263 @@ toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) function.h \
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DTARGET_NAME=\"$(target_alias)\" \
-c $(srcdir)/toplev.c $(OUTPUT_OPTION)
-main.o : main.c $(CONFIG_H) $(SYSTEM_H) toplev.h
+main.o : main.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h
-rtl-error.o: rtl-error.c system.h $(RTL_H) $(INSN_ATTR_H) insn-config.h \
- input.h toplev.h intl.h diagnostic.h $(CONFIG_H)
+rtl-error.o: rtl-error.c $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(INSN_ATTR_H) \
+ insn-config.h input.h toplev.h intl.h diagnostic.h $(CONFIG_H)
-rtl.o : rtl.c $(GCONFIG_H) $(SYSTEM_H) $(RTL_H) real.h $(GGC_H) errors.h
+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) $(RTL_H) $(TREE_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
-rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) toplev.h $(RTL_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
-errors.o : errors.c $(GCONFIG_H) $(SYSTEM_H) errors.h
+errors.o : errors.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h
$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
-varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
- function.h $(EXPR_H) hard-reg-set.h $(REGS_H) \
+varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
+ flags.h function.h $(EXPR_H) hard-reg-set.h $(REGS_H) \
output.h c-pragma.h toplev.h xcoffout.h debug.h $(GGC_H) $(TM_P_H) \
$(HASHTAB_H) $(TARGET_H) langhooks.h gt-varasm.h real.h
-function.o : function.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- function.h $(EXPR_H) libfuncs.h $(REGS_H) hard-reg-set.h \
+function.o : function.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
+ flags.h function.h $(EXPR_H) libfuncs.h $(REGS_H) hard-reg-set.h \
insn-config.h $(RECOG_H) output.h toplev.h except.h $(HASHTAB_H) $(GGC_H) \
$(TM_P_H) langhooks.h gt-function.h
-stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h function.h \
- insn-config.h hard-reg-set.h $(EXPR_H) libfuncs.h except.h \
+stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \
+ function.h insn-config.h hard-reg-set.h $(EXPR_H) libfuncs.h except.h \
$(LOOP_H) $(RECOG_H) toplev.h output.h varray.h $(GGC_H) $(TM_P_H) \
langhooks.h $(PREDICT_H) gt-stmt.h
-except.o : except.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- except.h function.h $(EXPR_H) libfuncs.h integrate.h langhooks.h \
+except.o : except.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
+ flags.h except.h function.h $(EXPR_H) libfuncs.h integrate.h langhooks.h \
insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \
dwarf2asm.h dwarf2out.h toplev.h $(HASHTAB_H) intl.h $(GGC_H) \
gt-except.h
-expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h function.h \
- $(REGS_H) $(EXPR_H) $(OPTABS_H) libfuncs.h insn-attr.h insn-config.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
-builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- $(TARGET_H) function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) insn-config.h \
+builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H)\
+ flags.h $(TARGET_H) function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) insn-config.h \
$(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
except.h $(TM_P_H) $(PREDICT_H) libfuncs.h real.h langhooks.h
-calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
+calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \
$(EXPR_H) langhooks.h $(TARGET_H) \
libfuncs.h $(REGS_H) toplev.h output.h function.h $(TIMEVAR_H) $(TM_P_H)
-expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) real.h \
+expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
+ flags.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) real.h \
toplev.h $(TM_P_H) langhooks.h
-explow.o : explow.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- hard-reg-set.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_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
-optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h $(RECOG_H) reload.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
-dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
- $(REGS_H) debug.h $(TM_P_H) $(TARGET_H) function.h langhooks.h \
+dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
+ flags.h $(REGS_H) debug.h $(TM_P_H) $(TARGET_H) function.h langhooks.h \
insn-config.h reload.h gstab.h xcoffout.h output.h dbxout.h toplev.h
-debug.o : debug.c debug.h $(CONFIG_H) $(SYSTEM_H)
-sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) 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 \
+debug.o : debug.c debug.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
+sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
+ 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) $(TREE_H) $(RTL_H) dwarf.h \
- flags.h insn-config.h reload.h output.h toplev.h $(TM_P_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
-dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) dwarf2.h \
- debug.h flags.h insn-config.h reload.h output.h diagnostic.h real.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 \
$(GGC_H) except.h dwarf2asm.h $(TM_P_H) langhooks.h $(HASHTAB_H) gt-dwarf2out.h
-dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) flags.h $(RTL_H) $(TREE_H) \
- output.h dwarf2asm.h $(TM_P_H) $(GGC_H)
-vmsdbgout.o : vmsdbgout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
- output.h vmsdbg.h debug.h langhooks.h function.h
-xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) xcoffout.h \
- flags.h toplev.h output.h dbxout.h $(GGC_H) $(TARGET_H)
-emit-rtl.o : emit-rtl.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- function.h $(REGS_H) insn-config.h $(RECOG_H) real.h $(GGC_H) \
+dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) flags.h $(RTL_H) \
+ $(TREE_H) output.h dwarf2asm.h $(TM_P_H) $(GGC_H)
+vmsdbgout.o : vmsdbgout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ $(RTL_H) flags.h output.h vmsdbg.h debug.h langhooks.h function.h $(TARGET_H)
+xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
+ xcoffout.h flags.h toplev.h output.h dbxout.h $(GGC_H) $(TARGET_H)
+emit-rtl.o : emit-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
+ flags.h function.h $(REGS_H) insn-config.h $(RECOG_H) real.h $(GGC_H) \
$(EXPR_H) $(srcdir)/../include/obstack.h hard-reg-set.h bitmap.h toplev.h \
$(HASHTAB_H) $(TM_P_H) debug.h langhooks.h
-real.o : real.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) toplev.h $(TM_P_H)
-integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- debug.h $(INTEGRATE_H) insn-config.h $(EXPR_H) real.h $(REGS_H) \
+real.o : real.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) toplev.h $(TM_P_H)
+integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
+ flags.h debug.h $(INTEGRATE_H) insn-config.h $(EXPR_H) real.h $(REGS_H) \
intl.h function.h output.h $(RECOG_H) except.h toplev.h $(LOOP_H) \
$(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h gt-integrate.h
-jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h hard-reg-set.h $(REGS_H) \
- insn-config.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \
+jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
+ hard-reg-set.h $(REGS_H) insn-config.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \
toplev.h $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H)
-simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) \
- hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
+simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ $(REGS_H) hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
output.h function.h $(GGC_H) $(OBSTACK_H) $(TM_P_H) $(TREE_H)
-cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) \
+cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
output.h function.h cselib.h $(GGC_H) $(TM_P_H) gt-cselib.h
-cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \
- real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h output.h function.h \
- $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_H)
-gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_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
-sibcall.o : sibcall.c $(CONFIG_H) $(SYSTEM_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) \
- $(BASIC_BLOCK_H) $(REGS_H) flags.h output.h resource.h function.h toplev.h \
+cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
+ hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h output.h \
+ function.h $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_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
+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 \
+ $(TM_H) $(BASIC_BLOCK_H) $(REGS_H) flags.h output.h resource.h function.h toplev.h \
$(INSN_ATTR_H) except.h $(PARAMS_H) $(TM_P_H)
-lcm.o : lcm.c $(CONFIG_H) $(SYSTEM_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
-ssa.o : ssa.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) varray.h $(EXPR_H) \
- hard-reg-set.h flags.h function.h real.h insn-config.h $(RECOG_H) \
+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
+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) $(RTL_H) hard-reg-set.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 $(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 $(RTL_H) insn-config.h $(RECOG_H) \
- function.h $(REGS_H) $(OBSTACK_H) hard-reg-set.h $(BASIC_BLOCK_H) df.h \
- $(FIBHEAP_H)
-conflict.o : conflict.c $(CONFIG_H) $(SYSTEM_H) $(OBSTACK_H) $(HASHTAB_H) \
- $(RTL_H) hard-reg-set.h $(BASIC_BLOCK_H)
-profile.o : profile.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- insn-config.h output.h $(REGS_H) $(EXPR_H) function.h \
- gcov-io.h toplev.h $(GGC_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TARGET_H) \
- langhooks.h profile.h libfuncs.h gt-profile.h
-loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h $(LOOP_H) \
+df.o : df.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) coretypes.h $(TM_H) $(RTL_H) \
+ insn-config.h $(RECOG_H) function.h $(REGS_H) $(OBSTACK_H) hard-reg-set.h \
+ $(BASIC_BLOCK_H) df.h $(FIBHEAP_H)
+conflict.o : conflict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(OBSTACK_H) \
+ $(HASHTAB_H) $(RTL_H) hard-reg-set.h $(BASIC_BLOCK_H)
+profile.o : profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
+ flags.h insn-config.h output.h $(REGS_H) $(EXPR_H) function.h \
+ gcov-io.h gcov-iov.h toplev.h $(GGC_H) hard-reg-set.h $(BASIC_BLOCK_H) \
+ $(TARGET_H) langhooks.h profile.h libfuncs.h gt-profile.h $(HASHTAB_H)
+loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h $(LOOP_H) \
insn-config.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) \
real.h $(PREDICT_H) $(BASIC_BLOCK_H) function.h \
toplev.h varray.h except.h cselib.h $(OPTABS_H) $(TM_P_H)
-doloop.o : doloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h $(LOOP_H) \
- $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) toplev.h
-unroll.o : unroll.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) insn-config.h function.h \
- $(INTEGRATE_H) $(REGS_H) $(RECOG_H) flags.h $(EXPR_H) $(LOOP_H) toplev.h \
+doloop.o : doloop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
+ $(LOOP_H) $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) toplev.h
+unroll.o : unroll.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) insn-config.h \
+ function.h $(INTEGRATE_H) $(REGS_H) $(RECOG_H) flags.h $(EXPR_H) $(LOOP_H) toplev.h \
hard-reg-set.h varray.h $(BASIC_BLOCK_H) $(TM_P_H) $(PREDICT_H) $(PARAMS_H)
-flow.o : flow.c $(CONFIG_H) $(SYSTEM_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)
-cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h insn-config.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)
+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)
-cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h insn-config.h \
- $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
+cfgrtl.o : cfgrtl.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) insn-config.h
-cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(BASIC_BLOCK_H) \
- hard-reg-set.h insn-config.h $(RECOG_H) $(GGC_H) $(TM_P_H)
-cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h insn-config.h \
- $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
+cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ $(BASIC_BLOCK_H) hard-reg-set.h insn-config.h $(RECOG_H) $(GGC_H) $(TM_P_H)
+cfgbuild.o : cfgbuild.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)
-cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TIMEVAR_H)\
- $(BASIC_BLOCK_H) hard-reg-set.h output.h flags.h $(RECOG_H) toplev.h \
+cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ $(TIMEVAR_H) $(BASIC_BLOCK_H) hard-reg-set.h output.h flags.h $(RECOG_H) toplev.h \
$(GGC_H) insn-config.h cselib.h $(TARGET_H) $(TM_P_H)
-cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
+cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(BASIC_BLOCK_H) hard-reg-set.h
-dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) hard-reg-set.h \
- $(BASIC_BLOCK_H) et-forest.h
-et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) et-forest.h
-combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h function.h \
- insn-config.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) \
+dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ hard-reg-set.h $(BASIC_BLOCK_H) et-forest.h
+et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) et-forest.h
+combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
+ function.h insn-config.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) \
$(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h $(TM_P_H)
-regclass.o : regclass.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) hard-reg-set.h flags.h \
- $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h real.h \
- toplev.h function.h output.h $(GGC_H) $(TM_P_H) $(EXPR_H)
-local-alloc.o : local-alloc.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h \
- $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
+regclass.o : regclass.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ hard-reg-set.h flags.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h \
+ real.h toplev.h function.h output.h $(GGC_H) $(TM_P_H) $(EXPR_H)
+local-alloc.o : local-alloc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ flags.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
output.h function.h $(INSN_ATTR_H) toplev.h except.h $(TM_P_H)
-bitmap.o : bitmap.c $(GCONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h \
+bitmap.o : bitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(RTL_H) flags.h \
$(BASIC_BLOCK_H) $(REGS_H) $(GGC_H)
$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
-global.o : global.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h reload.h function.h \
- $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h output.h toplev.h \
- $(TM_P_H)
-varray.o : varray.c $(CONFIG_H) $(SYSTEM_H) varray.h $(GGC_H) errors.h
-ra.o : ra.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_P_H) insn-config.h \
+global.o : global.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
+ reload.h function.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h output.h \
+ toplev.h $(TM_P_H)
+varray.o : varray.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) varray.h $(GGC_H) errors.h
+ra.o : ra.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TM_P_H) insn-config.h \
$(RECOG_H) integrate.h function.h $(REGS_H) $(OBSTACK_H) hard-reg-set.h \
$(BASIC_BLOCK_H) df.h expr.h output.h toplev.h flags.h reload.h ra.h
-ra-build.o : ra-build.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_P_H) \
+ra-build.o : ra-build.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TM_P_H) \
insn-config.h $(RECOG_H) function.h $(REGS_H) hard-reg-set.h \
$(BASIC_BLOCK_H) df.h output.h ggc.h ra.h gt-ra-build.h reload.h
-ra-colorize.o : ra-colorize.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_P_H) \
- function.h $(REGS_H) hard-reg-set.h $(BASIC_BLOCK_H) df.h output.h ra.h
-ra-debug.o : ra-debug.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) insn-config.h \
- $(RECOG_H) function.h hard-reg-set.h $(BASIC_BLOCK_H) df.h output.h ra.h \
- $(TM_P_H)
-ra-rewrite.o : ra-rewrite.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_P_H) \
- function.h $(REGS_H) hard-reg-set.h $(BASIC_BLOCK_H) df.h expr.h \
+ra-colorize.o : ra-colorize.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ $(TM_P_H) function.h $(REGS_H) hard-reg-set.h $(BASIC_BLOCK_H) df.h output.h ra.h
+ra-debug.o : ra-debug.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ insn-config.h $(RECOG_H) function.h hard-reg-set.h $(BASIC_BLOCK_H) df.h output.h \
+ ra.h $(TM_P_H)
+ra-rewrite.o : ra-rewrite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ $(TM_P_H) function.h $(REGS_H) hard-reg-set.h $(BASIC_BLOCK_H) df.h expr.h \
output.h except.h ra.h reload.h insn-config.h
-reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h output.h \
+reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h output.h \
$(EXPR_H) $(OPTABS_H) reload.h $(RECOG_H) hard-reg-set.h insn-config.h \
$(REGS_H) function.h real.h toplev.h $(TM_P_H)
-reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) real.h flags.h \
+reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) real.h flags.h \
$(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \
$(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h cselib.h $(TM_P_H) \
except.h $(TREE_H)
-caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h \
- $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) function.h \
+caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ flags.h $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) function.h \
$(RECOG_H) reload.h $(EXPR_H) toplev.h $(TM_P_H)
-reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) conditions.h hard-reg-set.h \
- $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(INSN_ATTR_H) except.h \
+reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) conditions.h \
+ hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(INSN_ATTR_H) except.h \
$(RECOG_H) function.h flags.h output.h $(EXPR_H) toplev.h $(PARAMS_H) $(TM_P_H)
-alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h hard-reg-set.h \
- $(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h $(EXPR_H) \
+alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
+ hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h $(EXPR_H) \
$(GGC_H) function.h cselib.h $(TREE_H) $(TM_P_H) langhooks.h $(TARGET_H) \
gt-alias.h
-regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) insn-config.h \
+regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) insn-config.h \
$(RECOG_H) output.h $(REGS_H) hard-reg-set.h flags.h function.h \
$(EXPR_H) $(BASIC_BLOCK_H) toplev.h $(TM_P_H) except.h reload.h
-haifa-sched.o : haifa-sched.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) sched-int.h \
- $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
+haifa-sched.o : haifa-sched.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ sched-int.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
$(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(TARGET_H)
-sched-deps.o : sched-deps.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) sched-int.h \
- $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
+sched-deps.o : sched-deps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ sched-int.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
$(INSN_ATTR_H) toplev.h $(RECOG_H) except.h cselib.h $(PARAMS_H) $(TM_P_H)
-sched-rgn.o : sched-rgn.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) sched-int.h \
- $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
+sched-rgn.o : sched-rgn.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ sched-int.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
$(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(TARGET_H)
-sched-ebb.o : sched-ebb.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) sched-int.h \
- $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
+sched-ebb.o : sched-ebb.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ sched-int.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
$(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H)
-sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) sched-int.h \
- hard-reg-set.h $(BASIC_BLOCK_H) $(INSN_ATTR_H) $(REGS_H) $(TM_P_H) \
+sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ sched-int.h hard-reg-set.h $(BASIC_BLOCK_H) $(INSN_ATTR_H) $(REGS_H) $(TM_P_H) \
$(TARGET_H) real.h
-final.o : final.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h intl.h \
- $(REGS_H) $(RECOG_H) conditions.h insn-config.h $(INSN_ATTR_H) function.h \
- real.h output.h hard-reg-set.h except.h debug.h xcoffout.h profile.h \
- toplev.h reload.h dwarf2out.h $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H) $(EXPR_H)
-recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) function.h $(BASIC_BLOCK_H) \
- $(REGS_H) $(RECOG_H) $(EXPR_H) hard-reg-set.h flags.h insn-config.h \
+final.o : final.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
+ flags.h intl.h $(REGS_H) $(RECOG_H) conditions.h insn-config.h $(INSN_ATTR_H) \
+ function.h real.h output.h hard-reg-set.h except.h debug.h xcoffout.h \
+ toplev.h reload.h dwarf2out.h $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H) \
+ $(EXPR_H)
+recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) function.h \
+ $(BASIC_BLOCK_H) $(REGS_H) $(RECOG_H) $(EXPR_H) hard-reg-set.h flags.h insn-config.h \
$(INSN_ATTR_H) real.h toplev.h output.h reload.h $(TM_P_H)
-reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) $(RECOG_H) \
- $(REGS_H) hard-reg-set.h flags.h insn-config.h toplev.h reload.h \
+reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
+ $(RECOG_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h toplev.h reload.h \
varray.h function.h $(TM_P_H) $(GGC_H) gt-reg-stack.h
-predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
- insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
+predict.o: predict.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) $(TM_P_H) $(PREDICT_H) real.h \
$(PARAMS_H) $(TARGET_H)
-lists.o: lists.c $(CONFIG_H) $(SYSTEM_H) toplev.h $(RTL_H) $(GGC_H)
-bb-reorder.o : bb-reorder.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) \
- flags.h $(BASIC_BLOCK_H) hard-reg-set.h output.h cfglayout.h $(TARGET_H)
-tracer.o : tracer.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_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) \
+ $(TREE_H) flags.h $(BASIC_BLOCK_H) hard-reg-set.h output.h cfglayout.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 \
$(PARAMS_H) profile.h
-cfglayout.o : cfglayout.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_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 function.h \
cfglayout.h
-timevar.o : timevar.c $(CONFIG_H) $(SYSTEM_H) $(TIMEVAR_H) flags.h intl.h
-regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) insn-config.h \
- $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h $(RECOG_H) function.h \
+timevar.o : timevar.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TIMEVAR_H) flags.h \
+ intl.h
+regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h $(RECOG_H) function.h \
resource.h $(OBSTACK_H) flags.h $(TM_P_H)
-ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) toplev.h \
+ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) toplev.h \
flags.h insn-config.h function.h $(RECOG_H) $(BASIC_BLOCK_H) $(EXPR_H) \
output.h except.h $(TM_P_H) real.h
-params.o : params.c $(CONFIG_H) $(SYSTEM_H) $(PARAMS_H) toplev.h
-hooks.o: hooks.c $(CONFIG_H) $(SYSTEM_H) $(HOOKS_H)
+params.o : params.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(PARAMS_H) toplev.h
+hooks.o: hooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(HOOKS_H)
-$(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) $(GGC_H) \
+$(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) $(GGC_H) \
$(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \
output.h $(INSN_ATTR_H) $(SYSTEM_H) toplev.h $(TARGET_H) libfuncs.h \
$(TARGET_DEF_H) function.h sched-int.h $(TM_P_H) $(EXPR_H) $(OPTABS_H) \
@@ -1659,12 +1675,12 @@ $(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) $(GGC_H) \
mips-tfile: mips-tfile.o version.o $(LIBDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS)
-mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) version.h
+mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h $(TM_H) version.h
mips-tdump: mips-tdump.o version.o $(LIBDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tdump.o version.o $(LIBS)
-mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H)
+mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h $(TM_H)
#
# Generate header and source files from the machine description,
@@ -1705,13 +1721,15 @@ s-conditions : $(md_file) genconditions$(build_exeext) $(srcdir)/move-if-change
$(SHELL) $(srcdir)/move-if-change tmp-conditions.c insn-conditions.c
$(STAMP) s-conditions
-insn-conditions.o : insn-conditions.c $(GCONFIG_H) $(SYSTEM_H) $(RTL_H) \
- $(TM_P_H) $(REGS_H) function.h $(RECOG_H) real.h output.h flags.h \
- hard-reg-set.h resource.h toplev.h reload.h gensupport.h insn-constants.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) insn-conditions.c
+insn-conditions.o : insn-conditions.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(GTM_H) $(RTL_H) $(TM_P_H) $(REGS_H) function.h $(RECOG_H) real.h output.h \
+ flags.h hard-reg-set.h resource.h toplev.h reload.h gensupport.h \
+ insn-constants.h
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) insn-conditions.c
-dummy-conditions.o : dummy-conditions.c $(HCONFIG_H) $(SYSTEM_H) gensupport.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
+dummy-conditions.o : dummy-conditions.c $(BCONFIG_H) $(SYSTEM_H) \
+ coretypes.h $(GTM_H) gensupport.h
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
$(srcdir)/dummy-conditions.c $(OUTPUT_OPTION)
insn-flags.h: s-flags ; @true
@@ -1732,9 +1750,9 @@ s-constants : $(md_file) genconstants$(build_exeext) $(srcdir)/move-if-change
$(SHELL) $(srcdir)/move-if-change tmp-constants.h insn-constants.h
$(STAMP) s-constants
-insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) $(EXPR_H) real.h output.h \
- insn-config.h $(OPTABS_H) $(SYSTEM_H) reload.h $(RECOG_H) toplev.h \
- function.h flags.h hard-reg-set.h resource.h $(TM_P_H)
+insn-emit.o : insn-emit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(RTL_H) $(EXPR_H) real.h output.h insn-config.h $(OPTABS_H) reload.h \
+ $(RECOG_H) toplev.h function.h flags.h hard-reg-set.h resource.h $(TM_P_H)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c \
$(OUTPUT_OPTION)
@@ -1744,9 +1762,9 @@ s-emit : $(md_file) genemit$(build_exeext) $(srcdir)/move-if-change
$(SHELL) $(srcdir)/move-if-change tmp-emit.c insn-emit.c
$(STAMP) s-emit
-insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h $(RECOG_H) \
- real.h output.h flags.h $(SYSTEM_H) function.h hard-reg-set.h resource.h \
- $(TM_P_H) toplev.h reload.h
+insn-recog.o : insn-recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(RTL_H) insn-config.h $(RECOG_H) real.h output.h flags.h function.h \
+ hard-reg-set.h resource.h $(TM_P_H) toplev.h reload.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c \
$(OUTPUT_OPTION)
@@ -1756,8 +1774,8 @@ s-recog : $(md_file) genrecog$(build_exeext) $(srcdir)/move-if-change
$(SHELL) $(srcdir)/move-if-change tmp-recog.c insn-recog.c
$(STAMP) s-recog
-insn-opinit.o : insn-opinit.c $(CONFIG_H) $(RTL_H) \
- insn-config.h flags.h $(RECOG_H) $(EXPR_H) $(OPTABS_H) reload.h $(SYSTEM_H)
+insn-opinit.o : insn-opinit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(RTL_H) insn-config.h flags.h $(RECOG_H) $(EXPR_H) $(OPTABS_H) reload.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-opinit.c \
$(OUTPUT_OPTION)
@@ -1767,8 +1785,8 @@ s-opinit : $(md_file) genopinit$(build_exeext) $(srcdir)/move-if-change
$(SHELL) $(srcdir)/move-if-change tmp-opinit.c insn-opinit.c
$(STAMP) s-opinit
-insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) toplev.h \
- insn-config.h $(RECOG_H)
+insn-extract.o : insn-extract.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(RTL_H) toplev.h insn-config.h $(RECOG_H)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c \
$(OUTPUT_OPTION)
@@ -1778,8 +1796,9 @@ s-extract : $(md_file) genextract$(build_exeext) $(srcdir)/move-if-change
$(SHELL) $(srcdir)/move-if-change tmp-extract.c insn-extract.c
$(STAMP) s-extract
-insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) $(REGS_H) output.h real.h \
- $(SYSTEM_H) insn-config.h $(RECOG_H) except.h function.h $(TM_P_H)
+insn-peep.o : insn-peep.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(RTL_H) $(REGS_H) output.h real.h insn-config.h $(RECOG_H) except.h \
+ function.h $(TM_P_H)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c \
$(OUTPUT_OPTION)
@@ -1789,9 +1808,9 @@ s-peep : $(md_file) genpeep$(build_exeext) $(srcdir)/move-if-change
$(SHELL) $(srcdir)/move-if-change tmp-peep.c insn-peep.c
$(STAMP) s-peep
-insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) $(REGS_H) real.h \
- output.h $(INSN_ATTR_H) insn-config.h $(SYSTEM_H) toplev.h $(RECOG_H) \
- $(TM_P_H) flags.h
+insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(RTL_H) $(REGS_H) real.h output.h $(INSN_ATTR_H) insn-config.h toplev.h \
+ $(RECOG_H) $(TM_P_H) flags.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c \
$(OUTPUT_OPTION)
@@ -1807,10 +1826,10 @@ s-attrtab : $(md_file) genattrtab$(build_exeext) $(srcdir)/move-if-change
$(SHELL) $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
$(STAMP) s-attrtab
-insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) $(GGC_H) $(REGS_H) real.h \
- conditions.h hard-reg-set.h insn-config.h $(INSN_ATTR_H) $(EXPR_H) \
- output.h $(RECOG_H) function.h $(SYSTEM_H) toplev.h flags.h \
- insn-codes.h $(TM_P_H)
+insn-output.o : insn-output.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(RTL_H) $(GGC_H) $(REGS_H) real.h conditions.h hard-reg-set.h \
+ insn-config.h $(INSN_ATTR_H) $(EXPR_H) output.h $(RECOG_H) function.h \
+ toplev.h flags.h insn-codes.h $(TM_P_H) $(TARGET_H)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c \
$(OUTPUT_OPTION)
@@ -1820,7 +1839,8 @@ s-output : $(md_file) genoutput$(build_exeext) $(srcdir)/move-if-change
$(SHELL) $(srcdir)/move-if-change tmp-output.c insn-output.c
$(STAMP) s-output
-genrtl.o : genrtl.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) $(GGC_H)
+genrtl.o : genrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ $(GGC_H)
genrtl.c genrtl.h : s-genrtl
@true # force gnu make to recheck modification times.
@@ -1838,8 +1858,8 @@ s-preds: genpreds$(build_exeext) $(srcdir)/move-if-change
$(SHELL) $(srcdir)/move-if-change tmp-preds.h tm-preds.h
$(STAMP) s-preds
-GTFILES = $(GCONFIG_H) $(srcdir)/location.h \
- $(HASHTAB_H) \
+GTFILES = $(srcdir)/location.h $(srcdir)/coretypes.h \
+ $(host_xm_file_list) $(tm_file_list) $(HASHTAB_H) \
$(srcdir)/bitmap.h $(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)/cselib.h \
@@ -1904,7 +1924,7 @@ s-gtype: gengtype$(build_exeext) $(GTFILES)
#
# Compile the programs that generate insn-* from the machine description.
-# They are compiled with $(HOST_CC), and associated libraries,
+# They are compiled with $(BUILD_CC), and associated libraries,
# since they need to run on this machine
# even if GCC is being compiled to run on some other machine.
@@ -1913,166 +1933,173 @@ s-gtype: gengtype$(build_exeext) $(GTFILES)
# about the target machine. They do depend on config.h itself,
# since that describes the host machine.
-read-rtl.o: read-rtl.c $(HCONFIG_H) $(SYSTEM_H) $(RTL_H) \
+read-rtl.o: read-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(RTL_H) \
$(OBSTACK_H) $(HASHTAB_H)
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/read-rtl.c $(OUTPUT_OPTION)
-
-gensupport.o: gensupport.c $(RTL_H) $(OBSTACK_H) $(SYSTEM_H) errors.h gensupport.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gensupport.c $(OUTPUT_OPTION)
-
-genconfig$(build_exeext) : genconfig.o $(HOST_RTL) $(HOST_SUPPORT) \
- $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
- genconfig.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
- $(HOST_ERRORS) $(HOST_LIBS)
-
-genconfig.o : genconfig.c $(RTL_H) $(HCONFIG_H) \
- $(SYSTEM_H) errors.h gensupport.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c $(OUTPUT_OPTION)
-
-genflags$(build_exeext) : genflags.o $(HOST_RTL) $(HOST_SUPPORT) \
- $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
- genflags.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
- $(HOST_ERRORS) $(HOST_LIBS)
-
-genflags.o : genflags.c $(RTL_H) $(OBSTACK_H) $(HCONFIG_H) \
- $(SYSTEM_H) errors.h gensupport.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c $(OUTPUT_OPTION)
-
-gencodes$(build_exeext) : gencodes.o $(HOST_RTL) $(HOST_SUPPORT) \
- $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
- gencodes.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
- $(HOST_ERRORS) $(HOST_LIBS)
-
-gencodes.o : gencodes.c $(RTL_H) $(HCONFIG_H) \
- $(SYSTEM_H) errors.h gensupport.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c $(OUTPUT_OPTION)
-
-genconstants$(build_exeext) : genconstants.o $(HOST_RTL) $(HOST_EARLY_SUPPORT) \
- $(HOST_ERRORS) $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
- genconstants.o $(HOST_EARLY_SUPPORT) $(HOST_RTL) \
- $(HOST_ERRORS) $(HOST_LIBS)
-
-genconstants.o : genconstants.c $(RTL_H) $(HCONFIG_H) $(SYSTEM_H) errors.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconstants.c $(OUTPUT_OPTION)
-
-genemit$(build_exeext) : genemit.o $(HOST_RTL) $(HOST_SUPPORT) \
- $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
- genemit.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
- $(HOST_ERRORS) $(HOST_LIBS)
-
-genemit.o : genemit.c $(RTL_H) $(HCONFIG_H) $(SYSTEM_H) errors.h gensupport.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c $(OUTPUT_OPTION)
-
-genopinit$(build_exeext) : genopinit.o $(HOST_RTL) $(HOST_SUPPORT) \
- $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
- genopinit.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
- $(HOST_ERRORS) $(HOST_LIBS)
-
-genopinit.o : genopinit.c $(RTL_H) $(HCONFIG_H) \
- $(SYSTEM_H) errors.h gensupport.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c $(OUTPUT_OPTION)
-
-genrecog$(build_exeext) : genrecog.o $(HOST_RTL) $(HOST_SUPPORT) \
- $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
- genrecog.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
- $(HOST_ERRORS) $(HOST_LIBS)
-
-genrecog.o : genrecog.c $(RTL_H) $(HCONFIG_H) \
- $(SYSTEM_H) errors.h gensupport.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c $(OUTPUT_OPTION)
-
-genextract$(build_exeext) : genextract.o $(HOST_RTL) $(HOST_SUPPORT) \
- $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
- genextract.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
- $(HOST_ERRORS) $(HOST_LIBS)
-
-genextract.o : genextract.c $(RTL_H) $(HCONFIG_H) \
- $(SYSTEM_H) insn-config.h errors.h gensupport.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c $(OUTPUT_OPTION)
-
-genpeep$(build_exeext) : genpeep.o $(HOST_RTL) $(HOST_SUPPORT) \
- $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
- genpeep.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
- $(HOST_ERRORS) $(HOST_LIBS)
-
-genpeep.o : genpeep.c $(RTL_H) $(HCONFIG_H) $(SYSTEM_H) errors.h gensupport.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c $(OUTPUT_OPTION)
-
-genattr$(build_exeext) : genattr.o $(HOST_RTL) $(HOST_SUPPORT) \
- $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
- genattr.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
- $(HOST_ERRORS) $(HOST_LIBS)
-
-genattr.o : genattr.c $(RTL_H) $(HCONFIG_H) $(SYSTEM_H) errors.h gensupport.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c $(OUTPUT_OPTION)
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/read-rtl.c $(OUTPUT_OPTION)
+
+gensupport.o: gensupport.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(RTL_H) \
+ $(OBSTACK_H) errors.h $(HASHTAB_H) gensupport.h
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gensupport.c $(OUTPUT_OPTION)
+
+genconfig$(build_exeext) : genconfig.o $(BUILD_RTL) $(BUILD_SUPPORT) \
+ $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ genconfig.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
+ $(BUILD_ERRORS) $(BUILD_LIBS)
+
+genconfig.o : genconfig.c $(RTL_H) $(BCONFIG_H) \
+ $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c $(OUTPUT_OPTION)
+
+genflags$(build_exeext) : genflags.o $(BUILD_RTL) $(BUILD_SUPPORT) \
+ $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ genflags.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
+ $(BUILD_ERRORS) $(BUILD_LIBS)
+
+genflags.o : genflags.c $(RTL_H) $(OBSTACK_H) $(BCONFIG_H) \
+ $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c $(OUTPUT_OPTION)
+
+gencodes$(build_exeext) : gencodes.o $(BUILD_RTL) $(BUILD_SUPPORT) \
+ $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ gencodes.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
+ $(BUILD_ERRORS) $(BUILD_LIBS)
+
+gencodes.o : gencodes.c $(RTL_H) $(BCONFIG_H) \
+ $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c $(OUTPUT_OPTION)
+
+genconstants$(build_exeext) : genconstants.o $(BUILD_RTL) $(BUILD_EARLY_SUPPORT) \
+ $(BUILD_ERRORS) $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ genconstants.o $(BUILD_EARLY_SUPPORT) $(BUILD_RTL) \
+ $(BUILD_ERRORS) $(BUILD_LIBS)
+
+genconstants.o : genconstants.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
+ errors.h
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genconstants.c $(OUTPUT_OPTION)
+
+genemit$(build_exeext) : genemit.o $(BUILD_RTL) $(BUILD_SUPPORT) \
+ $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ genemit.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
+ $(BUILD_ERRORS) $(BUILD_LIBS)
+
+genemit.o : genemit.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
+ errors.h gensupport.h
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c $(OUTPUT_OPTION)
+
+genopinit$(build_exeext) : genopinit.o $(BUILD_RTL) $(BUILD_SUPPORT) \
+ $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ genopinit.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
+ $(BUILD_ERRORS) $(BUILD_LIBS)
+
+genopinit.o : genopinit.c $(RTL_H) $(BCONFIG_H) \
+ $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c $(OUTPUT_OPTION)
+
+genrecog$(build_exeext) : genrecog.o $(BUILD_RTL) $(BUILD_SUPPORT) \
+ $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ genrecog.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
+ $(BUILD_ERRORS) $(BUILD_LIBS)
+
+genrecog.o : genrecog.c $(RTL_H) $(BCONFIG_H) \
+ $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c $(OUTPUT_OPTION)
+
+genextract$(build_exeext) : genextract.o $(BUILD_RTL) $(BUILD_SUPPORT) \
+ $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ genextract.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
+ $(BUILD_ERRORS) $(BUILD_LIBS)
+
+genextract.o : genextract.c $(RTL_H) $(BCONFIG_H) \
+ $(SYSTEM_H) coretypes.h $(GTM_H) insn-config.h errors.h gensupport.h
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c $(OUTPUT_OPTION)
+
+genpeep$(build_exeext) : genpeep.o $(BUILD_RTL) $(BUILD_SUPPORT) \
+ $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ genpeep.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
+ $(BUILD_ERRORS) $(BUILD_LIBS)
+
+genpeep.o : genpeep.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
+ errors.h gensupport.h
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c $(OUTPUT_OPTION)
+
+genattr$(build_exeext) : genattr.o $(BUILD_RTL) $(BUILD_SUPPORT) \
+ $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ genattr.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
+ $(BUILD_ERRORS) $(BUILD_LIBS)
+
+genattr.o : genattr.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h \
+ gensupport.h
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c $(OUTPUT_OPTION)
genattrtab$(build_exeext) : genattrtab.o genautomata.o \
- $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_VARRAY) \
- $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
+ $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_VARRAY) \
+ $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
genattrtab.o genautomata.o \
- $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) $(HOST_ERRORS) \
- $(HOST_VARRAY) $(HOST_LIBS) -lm
+ $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) $(BUILD_ERRORS) \
+ $(BUILD_VARRAY) $(BUILD_LIBS) -lm
-genattrtab.o : genattrtab.c $(RTL_H) $(OBSTACK_H) $(HCONFIG_H) \
- $(SYSTEM_H) errors.h $(GGC_H) gensupport.h genattrtab.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c $(OUTPUT_OPTION)
+genattrtab.o : genattrtab.c $(RTL_H) $(OBSTACK_H) $(BCONFIG_H) \
+ $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(GGC_H) gensupport.h genattrtab.h
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c $(OUTPUT_OPTION)
-genautomata.o : genautomata.c $(RTL_H) $(OBSTACK_H) $(HCONFIG_H) \
- $(SYSTEM_H) errors.h varray.h genattrtab.h $(HASHTAB_H)
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genautomata.c $(OUTPUT_OPTION)
+genautomata.o : genautomata.c $(RTL_H) $(OBSTACK_H) $(BCONFIG_H) \
+ $(SYSTEM_H) coretypes.h $(GTM_H) errors.h varray.h genattrtab.h $(HASHTAB_H)
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genautomata.c $(OUTPUT_OPTION)
-genoutput$(build_exeext) : genoutput.o $(HOST_RTL) $(HOST_SUPPORT) \
- $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
- genoutput.o $(HOST_RTL) $(HOST_SUPPORT) $(HOST_PRINT) \
- $(HOST_ERRORS) $(HOST_LIBS)
+genoutput$(build_exeext) : genoutput.o $(BUILD_RTL) $(BUILD_SUPPORT) \
+ $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ genoutput.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
+ $(BUILD_ERRORS) $(BUILD_LIBS)
-genoutput.o : genoutput.c $(RTL_H) $(HCONFIG_H) \
- $(SYSTEM_H) errors.h gensupport.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c $(OUTPUT_OPTION)
+genoutput.o : genoutput.c $(RTL_H) $(BCONFIG_H) \
+ $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c $(OUTPUT_OPTION)
-gengenrtl$(build_exeext) : gengenrtl.o $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
- gengenrtl.o $(HOST_LIBS)
+gengenrtl$(build_exeext) : gengenrtl.o $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ gengenrtl.o $(BUILD_LIBS)
-gengenrtl.o : gengenrtl.c $(RTL_BASE_H) $(HCONFIG_H) $(SYSTEM_H) real.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gengenrtl.c $(OUTPUT_OPTION)
+gengenrtl.o : gengenrtl.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(GTM_H) real.h
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gengenrtl.c $(OUTPUT_OPTION)
-genpreds$(build_exeext) : genpreds.o $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
- genpreds.o $(HOST_LIBS)
+genpreds$(build_exeext) : genpreds.o $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ genpreds.o $(BUILD_LIBS)
-genpreds.o : genpreds.c $(RTL_BASE_H) $(HCONFIG_H) $(SYSTEM_H)
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpreds.c $(OUTPUT_OPTION)
+genpreds.o : genpreds.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H)
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genpreds.c $(OUTPUT_OPTION)
gengtype$(build_exeext) : gengtype.o gengtype-lex.o gengtype-yacc.o \
- $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
- gengtype.o gengtype-lex.o gengtype-yacc.o $(HOST_LIBS)
+ $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ gengtype.o gengtype-lex.o gengtype-yacc.o $(BUILD_LIBS)
-gengtype.o : gengtype.c gengtype.h $(HCONFIG_H) $(SYSTEM_H) real.h rtl.def \
- gtyp-gen.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
+gengtype.o : gengtype.c gengtype.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
+ real.h rtl.def gtyp-gen.h
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
$(srcdir)/gengtype.c $(OUTPUT_OPTION)
gengtype-lex.o : $(srcdir)/gengtype-lex.c gengtype.h $(srcdir)/gengtype-yacc.c \
- $(HCONFIG_H) $(SYSTEM_H)
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
+ $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H)
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
$(srcdir)/gengtype-lex.c $(OUTPUT_OPTION)
-gengtype-yacc.o : $(srcdir)/gengtype-yacc.c gengtype.h $(HCONFIG_H) $(SYSTEM_H)
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
+gengtype-yacc.o : $(srcdir)/gengtype-yacc.c gengtype.h $(BCONFIG_H) $(SYSTEM_H) \
+ coretypes.h $(GTM_H)
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
$(srcdir)/gengtype-yacc.c $(OUTPUT_OPTION)
# The sed command works around a bug in flex-2.5.4.
@@ -2092,14 +2119,15 @@ $(srcdir)/gengtype-yacc.c: $(srcdir)/gengtype-yacc.y
$(BISON) $(BISONFLAGS) -d -o gengtype-yacc.c gengtype-yacc.y || \
( rm -f $@ && false ) )
-genconditions$(build_exeext) : genconditions.o $(HOST_EARLY_SUPPORT) \
- $(HOST_RTL) $(HOST_ERRORS) $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
- genconditions.o $(HOST_EARLY_SUPPORT) $(HOST_RTL) \
- $(HOST_ERRORS) $(HOST_LIBS)
+genconditions$(build_exeext) : genconditions.o $(BUILD_EARLY_SUPPORT) \
+ $(BUILD_RTL) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ genconditions.o $(BUILD_EARLY_SUPPORT) $(BUILD_RTL) \
+ $(BUILD_ERRORS) $(BUILD_LIBS)
-genconditions.o : genconditions.c $(RTL_H) $(HCONFIG_H) $(SYSTEM_H) errors.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
+genconditions.o : genconditions.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(GTM_H) errors.h
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
$(srcdir)/genconditions.c $(OUTPUT_OPTION)
#
@@ -2107,45 +2135,45 @@ genconditions.o : genconditions.c $(RTL_H) $(HCONFIG_H) $(SYSTEM_H) errors.h
# If we are not cross-building, gen* use the same .o's that cc1 will use,
# and BUILD_PREFIX_1 is `loser-', just to ensure these rules don't conflict
# with the rules for rtl.o, etc.
-$(BUILD_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(HCONFIG_H) $(SYSTEM_H) $(RTL_H) \
+$(BUILD_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) $(RTL_H) \
real.h $(GGC_H) errors.h
rm -f $(BUILD_PREFIX)rtl.c
- sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtl.c > $(BUILD_PREFIX)rtl.c
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)rtl.c $(OUTPUT_OPTION)
+ sed -e 's/config[.]h/bconfig.h/' $(srcdir)/rtl.c > $(BUILD_PREFIX)rtl.c
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)rtl.c $(OUTPUT_OPTION)
-print-rtl1.o: $(srcdir)/print-rtl.c $(HCONFIG_H) \
+print-rtl1.o: $(srcdir)/print-rtl.c $(BCONFIG_H) coretypes.h $(GTM_H) \
$(RTL_H) $(TREE_H) hard-reg-set.h $(BASIC_BLOCK_H)
rm -f print-rtl1.c
- sed -e 's/config[.]h/hconfig.h/' $(srcdir)/print-rtl.c > print-rtl1.c
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) print-rtl1.c $(OUTPUT_OPTION)
+ sed -e 's/config[.]h/bconfig.h/' $(srcdir)/print-rtl.c > print-rtl1.c
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) print-rtl1.c $(OUTPUT_OPTION)
-$(BUILD_PREFIX_1)bitmap.o: $(srcdir)/bitmap.c $(HCONFIG_H) $(SYSTEM_H) \
+$(BUILD_PREFIX_1)bitmap.o: $(srcdir)/bitmap.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) \
$(RTL_H) flags.h $(BASIC_BLOCK_H) $(REGS_H) $(GGC_H)
rm -f $(BUILD_PREFIX)bitmap.c
- sed -e 's/config[.]h/hconfig.h/' $(srcdir)/bitmap.c > $(BUILD_PREFIX)bitmap.c
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)bitmap.c $(OUTPUT_OPTION)
+ sed -e 's/config[.]h/bconfig.h/' $(srcdir)/bitmap.c > $(BUILD_PREFIX)bitmap.c
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)bitmap.c $(OUTPUT_OPTION)
-$(BUILD_PREFIX_1)errors.o: errors.c $(HCONFIG_H) $(SYSTEM_H) errors.h
+$(BUILD_PREFIX_1)errors.o: errors.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) errors.h
rm -f $(BUILD_PREFIX)errors.c
- sed -e 's/config[.]h/hconfig.h/' $(srcdir)/errors.c > $(BUILD_PREFIX)errors.c
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)errors.c $(OUTPUT_OPTION)
+ sed -e 's/config[.]h/bconfig.h/' $(srcdir)/errors.c > $(BUILD_PREFIX)errors.c
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)errors.c $(OUTPUT_OPTION)
-$(BUILD_PREFIX_1)varray.o: varray.c $(HCONFIG_H) $(SYSTEM_H) varray.h \
+$(BUILD_PREFIX_1)varray.o: varray.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) varray.h \
$(RTL_H) $(GGC_H) $(TREE_H) bitmap.h errors.h
rm -f $(BUILD_PREFIX)varray.c
- sed -e 's/config[.]h/hconfig.h/' $(srcdir)/varray.c > \
+ sed -e 's/config[.]h/bconfig.h/' $(srcdir)/varray.c > \
$(BUILD_PREFIX)varray.c
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
$(BUILD_PREFIX)varray.c $(OUTPUT_OPTION)
-$(BUILD_PREFIX_1)ggc-none.o: ggc-none.c $(HCONFIG_H) $(SYSTEM_H) $(GGC_H)
+$(BUILD_PREFIX_1)ggc-none.o: ggc-none.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) $(GGC_H)
rm -f $(BUILD_PREFIX)ggc-none.c
- sed -e 's/config[.]h/hconfig.h/' $(srcdir)/ggc-none.c > $(BUILD_PREFIX)ggc-none.c
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)ggc-none.c $(OUTPUT_OPTION)
+ sed -e 's/config[.]h/bconfig.h/' $(srcdir)/ggc-none.c > $(BUILD_PREFIX)ggc-none.c
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)ggc-none.c $(OUTPUT_OPTION)
#
# Remake internationalization support.
-intl.o: intl.c $(CONFIG_H) system.h intl.h Makefile
+intl.o: intl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h Makefile
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DLOCALEDIR=\"$(localedir)\" \
-c $(srcdir)/intl.c $(OUTPUT_OPTION)
@@ -2178,7 +2206,7 @@ PREPROCESSOR_DEFINES = \
-DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_alias)\" \
-DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
-DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
- -DCROSS_INCLUDE_DIR=\"$(gcc_tooldir)/sys-include\" \
+ -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
-DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\"
LIBCPP_OBJS = cpplib.o cpplex.o cppmacro.o cppexp.o cppfiles.o cpptrad.o \
@@ -2186,7 +2214,7 @@ LIBCPP_OBJS = cpplib.o cpplex.o cppmacro.o cppexp.o cppfiles.o cpptrad.o \
hashtable.o line-map.o mkdeps.o prefix.o mbchar.o
LIBCPP_DEPS = $(CPPLIB_H) cpphash.h line-map.h hashtable.h intl.h \
- $(OBSTACK_H) $(SYSTEM_H)
+ $(OBSTACK_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
# Most of the other archives built/used by this makefile are for
# targets. This one is strictly for the host.
@@ -2195,25 +2223,25 @@ libcpp.a: $(LIBCPP_OBJS)
$(AR) $(AR_FLAGS) libcpp.a $(LIBCPP_OBJS)
-$(RANLIB) libcpp.a
-cppmain.o: cppmain.c $(CONFIG_H) $(LIBCPP_DEPS)
+cppmain.o: cppmain.c $(LIBCPP_DEPS)
-cpperror.o: cpperror.c $(CONFIG_H) $(LIBCPP_DEPS)
-cppexp.o: cppexp.c $(CONFIG_H) $(LIBCPP_DEPS)
-cpplex.o: cpplex.c $(CONFIG_H) $(LIBCPP_DEPS) mbchar.h
-cppmacro.o: cppmacro.c $(CONFIG_H) $(LIBCPP_DEPS)
-cpplib.o: cpplib.c $(CONFIG_H) $(LIBCPP_DEPS)
-cpphash.o: cpphash.c $(CONFIG_H) $(LIBCPP_DEPS)
-cpptrad.o: cpptrad.c $(CONFIG_H) $(LIBCPP_DEPS)
-cppfiles.o: cppfiles.c $(CONFIG_H) $(LIBCPP_DEPS) $(SPLAY_TREE_H) mkdeps.h
-cppinit.o: cppinit.c $(CONFIG_H) $(LIBCPP_DEPS) cppdefault.h \
- mkdeps.h prefix.h
+cpperror.o: cpperror.c $(LIBCPP_DEPS)
+cppexp.o: cppexp.c $(LIBCPP_DEPS)
+cpplex.o: cpplex.c $(LIBCPP_DEPS) mbchar.h
+cppmacro.o: cppmacro.c $(LIBCPP_DEPS)
+cpplib.o: cpplib.c $(LIBCPP_DEPS)
+cpphash.o: cpphash.c $(LIBCPP_DEPS)
+cpptrad.o: cpptrad.c $(LIBCPP_DEPS)
+cppfiles.o: cppfiles.c $(LIBCPP_DEPS) $(SPLAY_TREE_H) mkdeps.h
+cppinit.o: cppinit.c $(LIBCPP_DEPS) cppdefault.h mkdeps.h prefix.h
-cppdefault.o: cppdefault.c $(CONFIG_H) $(SYSTEM_H) cppdefault.h Makefile
+cppdefault.o: cppdefault.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) cppdefault.h \
+ Makefile
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(PREPROCESSOR_DEFINES) \
-c $(srcdir)/cppdefault.c $(OUTPUT_OPTION)
-mkdeps.o: mkdeps.c $(CONFIG_H) $(SYSTEM_H) mkdeps.h
+mkdeps.o: mkdeps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) mkdeps.h
# Note for the stamp targets, we run the program `true' instead of
# having an empty command (nothing following the semicolon).
@@ -2229,7 +2257,7 @@ unprotoize$(exeext): unprotoize.o $(PROTO_OBJS) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ unprotoize.o $(PROTO_OBJS) $(LIBS)
protoize.o: protoize.c $(srcdir)/../include/getopt.h $(CONFIG_H) $(SYSTEM_H) \
- Makefile version.h
+ coretypes.h $(TM_H) Makefile version.h
(SHLIB_LINK='$(SHLIB_LINK)' \
SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
@@ -2284,13 +2312,25 @@ test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES)
diff $(srcdir)/protoize.c tmp-proto.c | cat
-rm -f tmp-proto.[cs] tmp-proto$(objext)
-gcov.o: gcov.c gcov-io.h intl.h $(SYSTEM_H) $(CONFIG_H)
+# gcov-iov.c is run on the build machine to generate gcov-iov.h from version.c
+gcov-iov.o: gcov-iov.c version.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) coretypes.h $(TM_H)
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gcov-iov.c $(OUTPUT_OPTION)
+gcov-iov$(build_exeext): gcov-iov.o
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) gcov-iov.o -o $@
+gcov-iov.h: gcov-iov$(build_exeext)
+ ./$< > $@
+
+gcov.o: gcov.c gcov-io.h gcov-iov.h intl.h $(SYSTEM_H) coretypes.h $(TM_H) $(CONFIG_H)
+gcov-dump.o: gcov-dump.c gcov-io.h gcov-iov.h $(SYSTEM_H) coretypes.h $(TM_H) $(CONFIG_H)
# Only one of 'gcov' or 'gcov.exe' is actually built, depending
# upon whether $(exeext) is empty or not.
GCOV_OBJS = gcov.o intl.o version.o
gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
+GCOV_DUMP_OBJS = gcov-dump.o version.o
+gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS)
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(GCOV_DUMP_OBJS) $(LIBS) -o $@
#
# Build the include directory. The stamp files are stmp-* rather than
# s-* so that mostlyclean does not force the include directory to
@@ -2338,13 +2378,23 @@ fixinc.sh: $(FIXINCSRCDIR)/mkfixinc.sh $(FIXINCSRCDIR)/fixincl.c \
$(FIXINCSRCDIR)/server.c $(FIXINCSRCDIR)/gnu-regex.h \
$(FIXINCSRCDIR)/server.h $(FIXINCSRCDIR)/inclhack.def specs.ready
(MAKE="$(MAKE)"; srcdir=`cd $(srcdir)/fixinc && ${PWD}` ; \
- CC="$(HOST_CC)"; CFLAGS="$(HOST_CFLAGS)"; LDFLAGS="$(HOST_LDFLAGS)"; \
+ CC="$(BUILD_CC)"; CFLAGS="$(BUILD_CFLAGS)"; LDFLAGS="$(BUILD_LDFLAGS)"; \
WARN_CFLAGS="$(WARN_CFLAGS)"; \
export MAKE srcdir CC CFLAGS LDFLAGS WARN_CFLAGS; cd ./fixinc && \
$(SHELL) $${srcdir}/mkfixinc.sh $(build_canonical) $(target))
+.PHONY: install-gcc-tooldir
+install-gcc-tooldir:
+ $(SHELL) ${srcdir}/mkinstalldirs $(gcc_tooldir)
+
# Build fixed copies of system files.
stmp-fixinc: fixinc.sh gsyslimits.h
+ @if test ! -d ${SYSTEM_HEADER_DIR}; then \
+ echo The directory that should contain system headers does not exist: >&2 ; \
+ echo " ${SYSTEM_HEADER_DIR}" >&2 ; \
+ if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \
+ then sleep 1; else exit 1; fi; \
+ fi
rm -rf include; mkdir include
-chmod a+rx include
(TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD}`; \
@@ -2358,29 +2408,15 @@ stmp-fixinc: fixinc.sh gsyslimits.h
cp $(srcdir)/gsyslimits.h include/syslimits.h; \
fi; \
chmod a+r include/syslimits.h)
-# If $(SYSTEM_HEADER_DIR) is $(build_tooldir)/sys-include, and
-# that directory exists, then make sure that $(libsubdir) exists.
-# This is because cpp is compiled to find $(gcc_tooldir)/include via
-# $(libsubdir)/$(unlibsubdir), which will only work if $(libsubdir)
-# exists.
-# ??? Better would be to use -isystem $(build_tooldir)/sys-include,
-# but fixincludes does not take such arguments.
- if [ "$(SYSTEM_HEADER_DIR)" = "$(build_tooldir)/sys-include" ] \
- && [ -d $(build_tooldir)/sys-include ]; then \
- if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; fi; \
- if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib; fi; \
- if [ -d $(libdir)/gcc-lib/$(target_alias) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias) ; fi; \
- if [ -d $(libdir)/gcc-lib/$(target_alias)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias)/$(version) ; fi; \
- else true; fi
$(STAMP) stmp-fixinc
# Files related to the fixproto script.
-# gen-protos and fix-header are compiled with HOST_CC, but they are only
+# gen-protos and fix-header are compiled with BUILD_CC, but they are only
# used in native and host-x-target builds, so it's safe to link them with
# libiberty.a.
deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs
- if [ -d $(SYSTEM_HEADER_DIR) ]; \
+ if [ -d "$(SYSTEM_HEADER_DIR)" ]; \
then \
CC="$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -I. -I$(srcdir) -isystem include -isystem ${SYSTEM_HEADER_DIR}"; \
export CC; \
@@ -2392,14 +2428,14 @@ deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs
GEN_PROTOS_OBJS = gen-protos.o scan.o
gen-protos$(build_exeext): $(GEN_PROTOS_OBJS)
- ${HOST_CC} $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
- $(GEN_PROTOS_OBJS) $(HOST_LIBS)
+ ${BUILD_CC} $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $(GEN_PROTOS_OBJS) $(BUILD_LIBS)
-gen-protos.o: gen-protos.c scan.h $(HCONFIG_H) $(SYSTEM_H)
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gen-protos.c $(OUTPUT_OPTION)
+gen-protos.o: gen-protos.c scan.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H)
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gen-protos.c $(OUTPUT_OPTION)
-scan.o: scan.c scan.h $(HCONFIG_H) $(SYSTEM_H)
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan.c $(OUTPUT_OPTION)
+scan.o: scan.c scan.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H)
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/scan.c $(OUTPUT_OPTION)
xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos$(build_exeext) Makefile
sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \
@@ -2415,15 +2451,15 @@ xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos$(build_
# so we can (indeed, must) use $(LIBDEPS) and $(LIBS).
fix-header$(build_exeext): fix-header.o scan-decls.o scan.o xsys-protos.h \
$(LIBDEPS) libcpp.a
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ fix-header.o \
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ fix-header.o \
scan-decls.o scan.o libcpp.a $(LIBS)
fix-header.o: fix-header.c $(OBSTACK_H) scan.h \
- xsys-protos.h $(HCONFIG_H) $(SYSTEM_H) $(CPPLIB_H)
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/fix-header.c $(OUTPUT_OPTION)
+ xsys-protos.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(CPPLIB_H)
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/fix-header.c $(OUTPUT_OPTION)
-scan-decls.o: scan-decls.c scan.h $(CPPLIB_H) $(HCONFIG_H) $(SYSTEM_H)
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan-decls.c $(OUTPUT_OPTION)
+scan-decls.o: scan-decls.c scan.h $(CPPLIB_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H)
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/scan-decls.c $(OUTPUT_OPTION)
# stmp-fixproto depends on this, not on fix-header directly.
# The idea is to make sure fix-header gets built,
@@ -2446,7 +2482,7 @@ stmp-fixproto: fixhdr.ready fixproto stmp-int-hdrs
FIXPROTO_DEFINES="$(FIXPROTO_DEFINES)"; export FIXPROTO_DEFINES; \
mkinstalldirs="$(SHELL) $(srcdir)/mkinstalldirs"; \
export mkinstalldirs; \
- if [ -d $(SYSTEM_HEADER_DIR) ] ; then \
+ if [ -d "$(SYSTEM_HEADER_DIR)" ]; then \
$(SHELL) ${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR); \
if [ $$? -eq 0 ] ; then true ; else exit 1 ; fi ; \
else true; fi; \
@@ -2605,7 +2641,7 @@ mostlyclean: $(INTL_MOSTLYCLEAN) lang.mostlyclean
# Delete the temporary source copies for cross compilation.
-rm -f $(BUILD_PREFIX_1)rtl.c $(BUILD_PREFIX_1)print-rtl.c
-rm -f $(BUILD_PREFIX_1)bitmap.c $(BUILD_PREFIX_1)errors.c
- -rm -f $(BUILD_PREFIX_1)ggc-none.c
+ -rm -f $(BUILD_PREFIX_1)ggc-none.c print-rtl1.c
# Delete the temp files made in the course of building libgcc.a.
-rm -f xlimits.h
# Delete other built files.
@@ -2643,7 +2679,7 @@ mostlyclean: $(INTL_MOSTLYCLEAN) lang.mostlyclean
INTL_CLEAN = intl.clean
clean: mostlyclean $(INTL_CLEAN) lang.clean
-rm -f libgcc.a libgcc_eh.a libgcc_s$(SHLIB_EXT) libgcc_s$(SHLIB_EXT).1
- -rm -f config.h tconfig.h hconfig.h tm_p.h
+ -rm -f config.h tconfig.h bconfig.h tm_p.h tm.h
-rm -f cs-*
-rm -rf libgcc
-rm -f *.dvi
@@ -2679,7 +2715,7 @@ distclean: clean $(INTL_DISTCLEAN) lang.distclean
-rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak
-rm -f testsuite/*.log testsuite/*.sum
-cd testsuite && rm -f x *.x *.x? *.exe *.rpo *.o *.s *.S *.c
- -cd testsuite && rm -f *.out *.gcov *.bb *.bbg
+ -cd testsuite && rm -f *.out *.gcov *$(coverageexts)
-rm -rf ${QMTEST_DIR} stamp-qmtest
-rm -f intl/libintl.h libintl.h
-rm -f cxxmain.c
@@ -3032,7 +3068,7 @@ install-mkheaders: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir \
$(itoolsdir)/fix-header$(build_exeext) ; \
else :; fi
$(INSTALL_PROGRAM) mkheaders $(itoolsdir)/mkheaders
- echo 'SYSTEM_HEADER_DIR="$(SYSTEM_HEADER_DIR)"' \
+ echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \
> $(itoolsdir)/mkheaders.conf
echo 'OTHER_FIXINCLUDES_DIRS="$(OTHER_FIXINCLUDES_DIRS)"' \
>> $(itoolsdir)/mkheaders.conf
@@ -3307,6 +3343,7 @@ VOL_FILES=`echo $(BACKEND) $(OBJS) $(C_OBJS) $(LIBCPP_OBJS) *.c *.h gen*`
# the context of the stage_x rule.
STAGE2_FLAGS_TO_PASS = \
ADAC="\$$(CC)" \
+ GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
CFLAGS="$(BOOT_CFLAGS)" \
LDFLAGS="$(BOOT_LDFLAGS)" \
WARN_CFLAGS="\$$(GCC_WARN_CFLAGS)" \
@@ -3324,6 +3361,7 @@ STAGE2_FLAGS_TO_PASS = \
stage1_build:
$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" \
CFLAGS="$(STAGE1_CFLAGS)" MAKEINFO="$(MAKEINFO)" \
+ GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
MAKEINFOFLAGS="$(MAKEINFOFLAGS)" COVERAGE_FLAGS=
$(STAMP) stage1_build
echo stage1_build > stage_last
@@ -3556,6 +3594,10 @@ stage1-start:
else true; \
fi; done
stage1: force stage1-start lang.stage1
+ -for dir in . $(SUBDIRS) ; \
+ do \
+ rm -f $$dir/*$(coverageexts) ; \
+ done
stage2-start:
-if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4
index 0cec464e2aa..0a954d81169 100644
--- a/gcc/aclocal.m4
+++ b/gcc/aclocal.m4
@@ -1,3 +1,5 @@
+sinclude(../config/accross.m4)
+
dnl See if stdbool.h properly defines bool and true/false.
AC_DEFUN(gcc_AC_HEADER_STDBOOL,
[AC_CACHE_CHECK([for working stdbool.h],
@@ -799,35 +801,6 @@ if test $gcc_cv_enum_bf_unsigned = yes; then
[Define if enumerated bitfields are treated as unsigned values.])
fi])
-dnl Host type sizes probe.
-dnl By Kaveh R. Ghazi. One typo fixed since.
-dnl
-AC_DEFUN([gcc_AC_COMPILE_CHECK_SIZEOF],
-[changequote(<<, >>)dnl
-dnl The name to #define.
-define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
-dnl The cache variable name.
-define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
-changequote([, ])dnl
-AC_MSG_CHECKING(size of $1)
-AC_CACHE_VAL(AC_CV_NAME,
-[for ac_size in 4 8 1 2 16 $3 ; do # List sizes in rough order of prevalence.
- AC_TRY_COMPILE([#include "confdefs.h"
-#include <sys/types.h>
-$2
-], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
- if test x$AC_CV_NAME != x ; then break; fi
-done
-])
-if test x$AC_CV_NAME = x ; then
- AC_MSG_ERROR([cannot determine a size for $1])
-fi
-AC_MSG_RESULT($AC_CV_NAME)
-AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
-undefine([AC_TYPE_NAME])dnl
-undefine([AC_CV_NAME])dnl
-])
-
dnl Probe number of bits in a byte.
dnl Note C89 requires CHAR_BIT >= 8.
dnl
@@ -958,49 +931,6 @@ fi
rm -rf conftest*
AC_LANG_RESTORE])
-dnl Host endianness probe.
-dnl This tests byte-within-word endianness. GCC actually needs
-dnl to know word-within-larger-object endianness. They are the
-dnl same on all presently supported hosts.
-dnl Differs from AC_C_BIGENDIAN in that it does not require
-dnl running a program on the host, and it defines the macro we
-dnl want to see.
-dnl
-AC_DEFUN([gcc_AC_C_COMPILE_ENDIAN],
-[AC_CACHE_CHECK(byte ordering, ac_cv_c_compile_endian,
-[ac_cv_c_compile_endian=unknown
-gcc_AC_EXAMINE_OBJECT([
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
-#endif
-/* This structure must have no internal padding. */
- struct {
- char prefix[sizeof "\nendian:" - 1];
- short word;
- char postfix[2];
- } tester = {
- "\nendian:",
-#if SIZEOF_SHORT == 4
- ('A' << (CHAR_BIT * 3)) | ('B' << (CHAR_BIT * 2)) |
-#endif
- ('A' << CHAR_BIT) | 'B',
- 'X', '\n'
-};],
- [if grep 'endian:AB' conftest.dmp >/dev/null 2>&1; then
- ac_cv_c_compile_endian=big-endian
- elif grep 'endian:BA' conftest.dmp >/dev/null 2>&1; then
- ac_cv_c_compile_endian=little-endian
- fi])
-])
-if test $ac_cv_c_compile_endian = unknown; then
- AC_MSG_ERROR([*** unable to determine endianness])
-elif test $ac_cv_c_compile_endian = big-endian; then
- AC_DEFINE(HOST_WORDS_BIG_ENDIAN, 1,
- [Define if the host machine stores words of multi-word integers in
- big-endian order.])
-fi
-])
-
dnl Floating point format probe.
dnl The basic concept is the same as the above: grep the object
dnl file for an interesting string. We have to watch out for
@@ -1063,12 +993,12 @@ format=
fbigend=
case $ac_cv_c_float_format in
'IEEE (big-endian)' )
- if test $ac_cv_c_compile_endian = little-endian; then
+ if test $ac_cv_c_bigendian = no; then
fbigend=1
fi
;;
'IEEE (little-endian)' )
- if test $ac_cv_c_compile_endian = big-endian; then
+ if test $ac_cv_c_bigendian = yes; then
fbigend=0
fi
;;
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 834922e2363..27e49962c0d 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -4,13 +4,20 @@
2002-12-14 Geert Bosch <bosch@gnat.com>
- * sem_ch6.adb (Analyze_Subprogram_Body): Recognize additional
- case of a body created for a Renaming_As_Body, on which
- conformance checks are not performed. Fixes PR ada/5690.
+ * sem_ch6.adb (Analyze_Subprogram_Body): Recognize additional
+ case of a body created for a Renaming_As_Body, on which
+ conformance checks are not performed. Fixes PR ada/5690.
+
+2002-11-30 Zack Weinberg <zack@codesourcery.com>
+
+ * cuintp.c, decl.c, deftarg.c, misc.c, targtyps.c, trans.c,
+ utils.c, utils2.c: Include coretypes.h and tm.h, and system.h when
+ not already included.
+ * Make-lang.in: Update dependencies.
2002-11-18 Nathanael Nerode <neroden@gcc.gnu.org>
* adaint.c (__gnat_tmp_name): Better, but good enough for now,
- solution to buffer overflow bug on GNU/Linux.
+ solution to buffer overflow bug on GNU/Linux.
2002-11-14 Nathanael Nerode <neroden@gcc.gnu.org>
Closes PR ada/5856 and PR ada/6919 !
@@ -32,7 +39,7 @@
2002-11-05 Graham Stott <graham.stott@btinternet.com>
PR ada/8358
* trans.c (gnu_pending_elaboration_lists): New GC root.
- (build_unit_elab): Use..
+ (build_unit_elab): Use..
2002-10-30 Geert Bosch <bosch@gnat.com>
PR ada/6558
@@ -41,12 +48,12 @@
* Make-lang.in (misc.o): Add dependency on optabs.h
2002-10-29 Geert Bosch <bosch@gnat.com>
- PR ada/6558
+ PR ada/6558
* Make-lang.in (gnatbind): Depend on CONFIG_H
2002-10-29 Geert bosch <bosch@gnat.com>
- PR ada/6558
- * misc.c: Unrevert misc.c (1.13)
+ PR ada/6558
+ * misc.c: Unrevert misc.c (1.13)
2002-10-28 Nathanael Nerode <neroden@gcc.gnu.org>
@@ -55,265 +62,265 @@
2002-09-25 Nathanael Nerode <neroden@gcc.gnu.org>
PR ada/5904
- * 5ataprop.adb 5atpopsp.adb 5bosinte.adb 5ftaprop.adb
- 5gtaprop.adb 5htaprop.adb 5rosinte.ads 5staprop.adb
- 5stpopse.adb 5vtaspri.ads 5zintman.adb 5ztaprop.adb
- 7staprop.adb: Correct statements in comments about
+ * 5ataprop.adb 5atpopsp.adb 5bosinte.adb 5ftaprop.adb
+ 5gtaprop.adb 5htaprop.adb 5rosinte.ads 5staprop.adb
+ 5stpopse.adb 5vtaspri.ads 5zintman.adb 5ztaprop.adb
+ 7staprop.adb: Correct statements in comments about
maintainership of GNAT.
PR ada/5904
- * 1ssecsta.adb 1ssecsta.ads adadecode.c adadecode.h aux-io.c
- gnatname.adb gnatname.ads mkdir.c osint-b.adb osint-b.ads
- osint-c.adb osint-c.ads osint-l.adb osint-l.ads osint-m.adb
- osint-m.ads prj-makr.adb prj-makr.ads prj-pp.adb prj-pp.ads
- s-atacco.ads s-traceb.adb s-traceb.ads s-traces.adb
- s-traces.ads s-tratas.adb s-tratas.ads sinput-d.adb
- sinput-d.ads switch-b.adb switch-b.ads switch-c.adb
+ * 1ssecsta.adb 1ssecsta.ads adadecode.c adadecode.h aux-io.c
+ gnatname.adb gnatname.ads mkdir.c osint-b.adb osint-b.ads
+ osint-c.adb osint-c.ads osint-l.adb osint-l.ads osint-m.adb
+ osint-m.ads prj-makr.adb prj-makr.ads prj-pp.adb prj-pp.ads
+ s-atacco.ads s-traceb.adb s-traceb.ads s-traces.adb
+ s-traces.ads s-tratas.adb s-tratas.ads sinput-d.adb
+ sinput-d.ads switch-b.adb switch-b.ads switch-c.adb
switch-c.ads switch-m.adb switch-m.ads: Correct statements in
comments about maintainership of GNAT.
PR ada/6919 (forward port of patch for PR ada/5904)
- * 1aexcept.adb 1aexcept.ads 41intnam.ads 42intnam.ads
- 4aintnam.ads 4cintnam.ads 4dintnam.ads 4hexcpol.adb
- 4lintnam.ads 4mintnam.ads 4nintnam.ads 4onumaux.ads
- 4pintnam.ads 4rintnam.ads 4sintnam.ads 4uintnam.ads
- 4vcalend.adb 4vintnam.ads 4wcalend.adb 4wexcpol.adb
- 4wintnam.ads 4zintnam.ads 4znumaux.ads 4zsytaco.adb
- 4zsytaco.ads 51osinte.adb 51osinte.ads 52osinte.adb
- 52osinte.ads 52system.ads 53osinte.ads 5aosinte.ads
- 5asystem.ads 5atasinf.ads 5ataspri.ads 5avxwork.ads
- 5bosinte.ads 5bsystem.ads 5cosinte.ads 5dosinte.ads
- 5esystem.ads 5fosinte.ads 5fsystem.ads 5ftasinf.ads
- 5ginterr.adb 5gmastop.adb 5gosinte.ads 5gproinf.adb
- 5gproinf.ads 5gsystem.ads 5gtasinf.adb 5gtasinf.ads
- 5gtpgetc.adb 5hparame.ads 5hsystem.ads 5htaspri.ads
- 5iosinte.ads 5itaspri.ads 5ksystem.ads 5kvxwork.ads
- 5losinte.ads 5lsystem.ads 5mosinte.ads 5mvxwork.ads
- 5ninmaop.adb 5nintman.adb 5nosinte.ads 5ntaspri.ads
- 5oosprim.adb 5oparame.adb 5osystem.ads 5posinte.ads
- 5posprim.adb 5pvxwork.ads 5rosinte.ads 5rparame.adb
- 5sintman.adb 5sosinte.ads 5sparame.adb 5ssystem.ads
- 5stasinf.adb 5stasinf.ads 5staspri.ads 5svxwork.ads
- 5tosinte.ads 5uosinte.ads 5vasthan.adb 5vinterr.adb
- 5vintman.ads 5vosinte.ads 5vosprim.adb 5vosprim.ads
- 5vparame.ads 5vsystem.ads 5vtaspri.ads 5vtpopde.adb
- 5vtpopde.ads 5vvaflop.adb 5wintman.adb 5wmemory.adb
- 5wosinte.ads 5wosprim.adb 5wsystem.ads 5wtaprop.adb
- 5wtaspri.ads 5ysystem.ads 5zinterr.adb 5zosinte.adb
- 5zosinte.ads 5zosprim.adb 5zsystem.ads 6vcpp.adb 6vcstrea.adb
- 7sosprim.adb 86numaux.adb 86numaux.ads 9drpc.adb a-astaco.adb
- a-caldel.ads a-calend.adb a-calend.ads a-chahan.adb
- a-chahan.ads a-colien.adb a-colien.ads a-colire.adb
- a-colire.ads a-comlin.adb a-comlin.ads a-cwila1.ads
- a-decima.adb a-decima.ads a-diocst.adb a-diocst.ads
- a-direio.adb a-direio.ads a-einuoc.adb a-einuoc.ads
- a-except.adb a-except.ads a-excpol.adb a-exctra.adb
- a-exctra.ads a-filico.adb a-filico.ads a-finali.adb
- a-finali.ads a-interr.ads a-intsig.adb a-intsig.ads
- a-ngcefu.adb a-ngcoty.adb a-ngcoty.ads a-ngelfu.adb
- a-nudira.adb a-nudira.ads a-nuflra.adb a-nuflra.ads
- a-numaux.ads a-reatim.ads a-retide.ads a-sequio.adb
- a-sequio.ads a-siocst.adb a-siocst.ads a-ssicst.adb
- a-ssicst.ads a-stmaco.ads a-storio.adb a-strbou.adb
- a-strbou.ads a-stream.ads a-strfix.adb a-strfix.ads
- a-strmap.adb a-strmap.ads a-strsea.adb a-strsea.ads
- a-strunb.adb a-strunb.ads a-ststio.adb a-ststio.ads
- a-stunau.adb a-stunau.ads a-stwibo.adb a-stwibo.ads
- a-stwifi.adb a-stwima.adb a-stwima.ads a-stwise.adb
- a-stwise.ads a-stwiun.adb a-stwiun.ads a-suteio.adb
- a-suteio.ads a-swmwco.ads a-swuwti.adb a-swuwti.ads
- a-sytaco.adb a-sytaco.ads a-tags.adb a-tags.ads a-tasatt.ads
- a-taside.adb a-taside.ads a-teioed.adb a-teioed.ads
- a-textio.adb a-textio.ads a-ticoau.adb a-ticoau.ads
- a-ticoio.adb a-ticoio.ads a-tideau.adb a-tideau.ads
- a-tideio.adb a-tideio.ads a-tienau.adb a-tienau.ads
- a-tienio.adb a-tienio.ads a-tifiio.adb a-tifiio.ads
- a-tiflau.adb a-tiflau.ads a-tiflio.adb a-tiflio.ads
- a-tigeau.adb a-tigeau.ads a-tiinau.adb a-tiinau.ads
- a-tiinio.adb a-tiinio.ads a-timoau.adb a-timoau.ads
- a-timoio.adb a-timoio.ads a-tiocst.adb a-tiocst.ads
- a-titest.adb a-witeio.adb a-witeio.ads a-wtcoau.adb
- a-wtcoau.ads a-wtcoio.adb a-wtcstr.adb a-wtcstr.ads
- a-wtdeau.adb a-wtdeau.ads a-wtdeio.adb a-wtdeio.ads
- a-wtedit.adb a-wtedit.ads a-wtenau.adb a-wtenau.ads
- a-wtenio.adb a-wtenio.ads a-wtfiio.adb a-wtfiio.ads
- a-wtflau.adb a-wtflau.ads a-wtflio.adb a-wtflio.ads
- a-wtgeau.adb a-wtgeau.ads a-wtinau.adb a-wtinau.ads
- a-wtinio.adb a-wtmoau.adb a-wtmoau.ads a-wtmoio.adb
- a-wtmoio.ads a-wttest.adb ada-tree.def ada-tree.h ada.h
- adaint.c adaint.h ali-util.adb ali-util.ads ali.adb ali.ads
- alloc.ads argv.c atree.adb atree.ads atree.h back_end.adb
- back_end.ads bcheck.adb bcheck.ads binde.adb binde.ads
- binderr.adb binderr.ads bindgen.adb bindgen.ads bindusg.adb
- bindusg.ads butil.adb butil.ads cal.c casing.adb casing.ads
- ceinfo.adb checks.adb checks.ads cio.c comperr.adb comperr.ads
- csets.adb csets.ads csinfo.adb cstand.adb cstand.ads
- cstreams.c cuintp.c debug.adb debug.ads debug_a.adb
- debug_a.ads dec-io.adb dec-io.ads dec.ads decl.c deftarg.c
- einfo.adb einfo.ads einfo.h elists.adb elists.ads elists.h
- errno.c errout.adb errout.ads eval_fat.adb eval_fat.ads exit.c
- exp_aggr.adb exp_aggr.ads exp_attr.adb exp_attr.ads
- exp_ch10.ads exp_ch11.adb exp_ch11.ads exp_ch12.adb
- exp_ch12.ads exp_ch13.adb exp_ch13.ads exp_ch2.adb exp_ch2.ads
- exp_ch3.adb exp_ch3.ads exp_ch4.adb exp_ch4.ads exp_ch5.adb
- exp_ch5.ads exp_ch6.adb exp_ch6.ads exp_ch7.adb exp_ch7.ads
- exp_ch8.adb exp_ch8.ads exp_ch9.adb exp_ch9.ads exp_code.adb
- exp_code.ads exp_dbug.adb exp_dbug.ads exp_disp.adb
- exp_disp.ads exp_dist.adb exp_dist.ads exp_fixd.adb
- exp_fixd.ads exp_imgv.adb exp_imgv.ads exp_intr.adb
- exp_intr.ads exp_pakd.adb exp_pakd.ads exp_prag.adb
- exp_prag.ads exp_smem.adb exp_smem.ads exp_strm.adb
- exp_strm.ads exp_tss.adb exp_tss.ads exp_util.adb exp_util.ads
- exp_vfpt.adb exp_vfpt.ads expander.adb expander.ads fe.h
- final.c fmap.adb fmap.ads fname-sf.adb fname-sf.ads
- fname-uf.adb fname-uf.ads fname.adb fname.ads freeze.adb
- freeze.ads frontend.adb frontend.ads g-calend.ads g-comlin.adb
- g-debpoo.adb g-debpoo.ads g-locfil.adb g-os_lib.ads
- g-regist.adb g-regist.ads get_targ.adb get_targ.ads gigi.h
- gmem.c gnat1drv.adb gnat1drv.ads gnat_ug.texi gnatbind.adb
- gnatbind.ads gnatbl.c gnatcmd.adb gnatcmd.ads gnatdll.adb
- gnatfind.adb gnatkr.adb gnatkr.ads gnatlbr.adb gnatlink.adb
- gnatlink.ads gnatls.adb gnatls.ads gnatmake.adb gnatmake.ads
- gnatmem.adb gnatprep.adb gnatprep.ads gnatpsta.adb gnatvsn.ads
- gnatxref.adb hlo.adb hlo.ads hostparm.ads i-c.adb i-cexten.ads
- i-cobol.adb i-cobol.ads i-cpoint.adb i-cpoint.ads i-cpp.adb
- i-cpp.ads i-cstrea.adb i-cstrea.ads i-cstrin.adb i-cstrin.ads
- i-fortra.adb i-os2err.ads i-os2lib.adb i-os2lib.ads
- i-os2syn.ads i-os2thr.ads i-pacdec.adb i-pacdec.ads
- impunit.adb impunit.ads init.c inline.adb inline.ads io-aux.c
- itypes.adb itypes.ads krunch.adb krunch.ads lang-options.h
- lang-specs.h layout.adb layout.ads lib-list.adb lib-load.adb
- lib-load.ads lib-sort.adb lib-util.adb lib-util.ads
- lib-writ.adb lib-writ.ads lib-xref.adb lib-xref.ads lib.adb
- lib.ads link.c live.adb live.ads make.adb make.ads makeusg.adb
- makeusg.ads math_lib.adb mdll.adb mdll.ads memtrack.adb misc.c
- namet.adb namet.ads namet.h nlists.adb nlists.ads nlists.h
- nmake.adb nmake.ads nmake.adt opt.adb opt.ads osint.adb
- osint.ads output.adb output.ads par-ch10.adb par-ch11.adb
- par-ch12.adb par-ch13.adb par-ch2.adb par-ch3.adb par-ch4.adb
- par-ch5.adb par-ch6.adb par-ch7.adb par-ch8.adb par-ch9.adb
- par-endh.adb par-labl.adb par-load.adb par-prag.adb
- par-sync.adb par-tchk.adb par-util.adb par.adb par.ads
- prj-attr.adb prj-attr.ads prj-com.adb prj-com.ads prj-dect.adb
- prj-dect.ads prj-env.adb prj-env.ads prj-ext.adb prj-ext.ads
- prj-nmsc.adb prj-nmsc.ads prj-pars.adb prj-pars.ads
- prj-part.adb prj-part.ads prj-proc.adb prj-proc.ads
- prj-strt.adb prj-strt.ads prj-tree.adb prj-tree.ads
- prj-util.adb prj-util.ads prj.adb prj.ads raise.c raise.h
- repinfo.adb repinfo.ads repinfo.h restrict.adb restrict.ads
- rident.ads rtsfind.adb rtsfind.ads s-addima.adb s-addima.ads
- s-arit64.adb s-arit64.ads s-assert.adb s-assert.ads
- s-asthan.adb s-asthan.ads s-atacco.adb s-auxdec.adb
- s-auxdec.ads s-bitops.adb s-bitops.ads s-chepoo.ads
- s-direio.adb s-direio.ads s-except.ads s-exctab.adb
- s-exctab.ads s-exnflt.ads s-exngen.adb s-exngen.ads
- s-exnint.ads s-exnlfl.ads s-exnlin.ads s-exnllf.ads
- s-exnlli.ads s-exnsfl.ads s-exnsin.ads s-exnssi.ads
- s-expflt.ads s-expgen.adb s-expgen.ads s-expint.ads
- s-explfl.ads s-explin.ads s-expllf.ads s-explli.ads
- s-expllu.adb s-expllu.ads s-expmod.adb s-expmod.ads
- s-expsfl.ads s-expsin.ads s-expssi.ads s-expuns.adb
- s-expuns.ads s-fatflt.ads s-fatgen.adb s-fatgen.ads
- s-fatlfl.ads s-fatllf.ads s-fatsfl.ads s-ficobl.ads
- s-fileio.adb s-fileio.ads s-finimp.adb s-finimp.ads
- s-finroo.adb s-finroo.ads s-fore.adb s-fore.ads s-imgbiu.adb
- s-imgbiu.ads s-imgboo.adb s-imgboo.ads s-imgcha.adb
- s-imgcha.ads s-imgdec.adb s-imgdec.ads s-imgenu.adb
- s-imgenu.ads s-imgint.adb s-imgint.ads s-imgllb.adb
- s-imgllb.ads s-imglld.adb s-imglld.ads s-imglli.adb
- s-imglli.ads s-imgllu.adb s-imgllu.ads s-imgllw.adb
- s-imgllw.ads s-imgrea.adb s-imgrea.ads s-imguns.adb
- s-imguns.ads s-imgwch.adb s-imgwch.ads s-imgwiu.adb
- s-imgwiu.ads s-inmaop.ads s-interr.adb s-interr.ads
- s-intman.ads s-io.adb s-io.ads s-maccod.ads s-mantis.adb
- s-mantis.ads s-memory.adb s-memory.ads s-osprim.ads
- s-pack03.adb s-pack03.ads s-pack05.adb s-pack05.ads
- s-pack06.adb s-pack06.ads s-pack07.adb s-pack07.ads
- s-pack09.adb s-pack09.ads s-pack10.adb s-pack10.ads
- s-pack11.adb s-pack11.ads s-pack12.adb s-pack12.ads
- s-pack13.adb s-pack13.ads s-pack14.adb s-pack14.ads
- s-pack15.adb s-pack15.ads s-pack17.adb s-pack17.ads
- s-pack18.adb s-pack18.ads s-pack19.adb s-pack19.ads
- s-pack20.adb s-pack20.ads s-pack21.adb s-pack21.ads
- s-pack22.adb s-pack22.ads s-pack23.adb s-pack23.ads
- s-pack24.adb s-pack24.ads s-pack25.adb s-pack25.ads
- s-pack26.adb s-pack26.ads s-pack27.adb s-pack27.ads
- s-pack28.adb s-pack28.ads s-pack29.adb s-pack29.ads
- s-pack30.adb s-pack30.ads s-pack31.adb s-pack31.ads
- s-pack33.adb s-pack33.ads s-pack34.adb s-pack34.ads
- s-pack35.adb s-pack35.ads s-pack36.adb s-pack36.ads
- s-pack37.adb s-pack37.ads s-pack38.adb s-pack38.ads
- s-pack39.adb s-pack39.ads s-pack40.adb s-pack40.ads
- s-pack41.adb s-pack41.ads s-pack42.adb s-pack42.ads
- s-pack43.adb s-pack43.ads s-pack44.adb s-pack44.ads
- s-pack45.adb s-pack45.ads s-pack46.adb s-pack46.ads
- s-pack47.adb s-pack47.ads s-pack48.adb s-pack48.ads
- s-pack49.adb s-pack49.ads s-pack50.adb s-pack50.ads
- s-pack51.adb s-pack51.ads s-pack52.adb s-pack52.ads
- s-pack53.adb s-pack53.ads s-pack54.adb s-pack54.ads
- s-pack55.adb s-pack55.ads s-pack56.adb s-pack56.ads
- s-pack57.adb s-pack57.ads s-pack58.adb s-pack58.ads
- s-pack59.adb s-pack59.ads s-pack60.adb s-pack60.ads
- s-pack61.adb s-pack61.ads s-pack62.adb s-pack62.ads
- s-pack63.adb s-pack63.ads s-parame.adb s-parame.ads
- s-parint.adb s-parint.ads s-pooglo.adb s-pooglo.ads
- s-pooloc.adb s-pooloc.ads s-poosiz.adb s-poosiz.ads
- s-powtab.ads s-proinf.adb s-proinf.ads s-rpc.adb s-rpc.ads
- s-scaval.ads s-secsta.adb s-secsta.ads s-sequio.adb
- s-sequio.ads s-shasto.adb s-shasto.ads s-soflin.adb
- s-soflin.ads s-sopco3.adb s-sopco3.ads s-sopco4.adb
- s-sopco4.ads s-sopco5.adb s-sopco5.ads s-stache.adb
- s-stache.ads s-stalib.adb s-stalib.ads s-stoele.adb
- s-stopoo.ads s-stratt.adb s-stratt.ads s-strops.adb
- s-strops.ads s-taprob.ads s-taprop.ads s-tarest.ads
- s-tasdeb.adb s-tasdeb.ads s-tasinf.adb s-tasinf.ads
- s-tasini.ads s-taskin.ads s-tasren.ads s-tasres.ads
- s-tassta.ads s-tpinop.adb s-tpinop.ads s-tpoben.ads
- s-tpobop.ads s-unstyp.ads s-vaflop.adb s-vaflop.ads
- s-valboo.adb s-valboo.ads s-valcha.adb s-valcha.ads
- s-valdec.adb s-valdec.ads s-valenu.adb s-valenu.ads
- s-valint.adb s-valint.ads s-vallld.adb s-vallld.ads
- s-vallli.adb s-vallli.ads s-valllu.adb s-valllu.ads
- s-valrea.adb s-valrea.ads s-valuns.adb s-valuns.ads
- s-valuti.adb s-valuti.ads s-valwch.adb s-valwch.ads
- s-vercon.adb s-vercon.ads s-vmexta.adb s-vmexta.ads
- s-wchcnv.adb s-wchcnv.ads s-wchcon.ads s-wchjis.adb
- s-wchjis.ads s-wchstw.adb s-wchstw.ads s-wchwts.adb
- s-wchwts.ads s-widboo.adb s-widboo.ads s-widcha.adb
- s-widcha.ads s-widenu.adb s-widenu.ads s-widlli.adb
- s-widlli.ads s-widllu.adb s-widllu.ads s-widwch.adb
- s-widwch.ads s-wwdcha.adb s-wwdcha.ads s-wwdenu.adb
- s-wwdenu.ads s-wwdwch.adb s-wwdwch.ads scans.adb scans.ads
- scn-nlit.adb scn-slit.adb scn.adb scn.ads sdefault.ads sem.adb
- sem.ads sem_aggr.adb sem_aggr.ads sem_attr.adb sem_attr.ads
- sem_case.adb sem_case.ads sem_cat.adb sem_cat.ads sem_ch10.adb
- sem_ch10.ads sem_ch11.adb sem_ch11.ads sem_ch12.adb
- sem_ch12.ads sem_ch13.adb sem_ch13.ads sem_ch2.adb sem_ch2.ads
- sem_ch3.adb sem_ch3.ads sem_ch4.adb sem_ch4.ads sem_ch5.adb
- sem_ch5.ads sem_ch6.adb sem_ch6.ads sem_ch7.adb sem_ch7.ads
- sem_ch8.adb sem_ch8.ads sem_ch9.adb sem_ch9.ads sem_disp.adb
- sem_disp.ads sem_dist.adb sem_dist.ads sem_elab.adb
- sem_elab.ads sem_elim.adb sem_elim.ads sem_eval.adb
- sem_eval.ads sem_intr.adb sem_intr.ads sem_maps.adb
- sem_maps.ads sem_mech.adb sem_mech.ads sem_prag.adb
- sem_prag.ads sem_res.adb sem_res.ads sem_smem.adb sem_smem.ads
- sem_type.adb sem_type.ads sem_util.adb sem_util.ads
- sem_vfpt.adb sem_vfpt.ads sem_warn.adb sem_warn.ads
- sfn_scan.adb sfn_scan.ads sinfo-cn.adb sinfo-cn.ads sinfo.adb
- sinfo.ads sinfo.h sinput-l.adb sinput-l.ads sinput-p.adb
- sinput-p.ads sinput.adb sinput.ads snames.adb snames.ads
- snames.h sprint.adb sprint.ads stand.adb stand.ads stringt.adb
- stringt.ads stringt.h style.adb style.ads stylesw.adb
- stylesw.ads switch.adb switch.ads sysdep.c system.ads
- table.adb table.ads targparm.adb targparm.ads targtyps.c
- tbuild.adb tbuild.ads trans.c tree_gen.adb tree_gen.ads
- tree_in.adb tree_in.ads tree_io.adb tree_io.ads treepr.adb
- treepr.ads treeprs.ads treeprs.adt ttypef.ads ttypes.ads
- types.adb types.ads types.h uintp.adb uintp.ads uintp.h
- uname.adb uname.ads urealp.adb urealp.ads urealp.h usage.adb
- usage.ads utils.c utils2.c validsw.adb validsw.ads
- widechar.adb widechar.ads xeinfo.adb xnmake.adb xr_tabls.adb
- xr_tabls.ads xref_lib.adb xref_lib.ads xsinfo.adb xsnames.adb
+ * 1aexcept.adb 1aexcept.ads 41intnam.ads 42intnam.ads
+ 4aintnam.ads 4cintnam.ads 4dintnam.ads 4hexcpol.adb
+ 4lintnam.ads 4mintnam.ads 4nintnam.ads 4onumaux.ads
+ 4pintnam.ads 4rintnam.ads 4sintnam.ads 4uintnam.ads
+ 4vcalend.adb 4vintnam.ads 4wcalend.adb 4wexcpol.adb
+ 4wintnam.ads 4zintnam.ads 4znumaux.ads 4zsytaco.adb
+ 4zsytaco.ads 51osinte.adb 51osinte.ads 52osinte.adb
+ 52osinte.ads 52system.ads 53osinte.ads 5aosinte.ads
+ 5asystem.ads 5atasinf.ads 5ataspri.ads 5avxwork.ads
+ 5bosinte.ads 5bsystem.ads 5cosinte.ads 5dosinte.ads
+ 5esystem.ads 5fosinte.ads 5fsystem.ads 5ftasinf.ads
+ 5ginterr.adb 5gmastop.adb 5gosinte.ads 5gproinf.adb
+ 5gproinf.ads 5gsystem.ads 5gtasinf.adb 5gtasinf.ads
+ 5gtpgetc.adb 5hparame.ads 5hsystem.ads 5htaspri.ads
+ 5iosinte.ads 5itaspri.ads 5ksystem.ads 5kvxwork.ads
+ 5losinte.ads 5lsystem.ads 5mosinte.ads 5mvxwork.ads
+ 5ninmaop.adb 5nintman.adb 5nosinte.ads 5ntaspri.ads
+ 5oosprim.adb 5oparame.adb 5osystem.ads 5posinte.ads
+ 5posprim.adb 5pvxwork.ads 5rosinte.ads 5rparame.adb
+ 5sintman.adb 5sosinte.ads 5sparame.adb 5ssystem.ads
+ 5stasinf.adb 5stasinf.ads 5staspri.ads 5svxwork.ads
+ 5tosinte.ads 5uosinte.ads 5vasthan.adb 5vinterr.adb
+ 5vintman.ads 5vosinte.ads 5vosprim.adb 5vosprim.ads
+ 5vparame.ads 5vsystem.ads 5vtaspri.ads 5vtpopde.adb
+ 5vtpopde.ads 5vvaflop.adb 5wintman.adb 5wmemory.adb
+ 5wosinte.ads 5wosprim.adb 5wsystem.ads 5wtaprop.adb
+ 5wtaspri.ads 5ysystem.ads 5zinterr.adb 5zosinte.adb
+ 5zosinte.ads 5zosprim.adb 5zsystem.ads 6vcpp.adb 6vcstrea.adb
+ 7sosprim.adb 86numaux.adb 86numaux.ads 9drpc.adb a-astaco.adb
+ a-caldel.ads a-calend.adb a-calend.ads a-chahan.adb
+ a-chahan.ads a-colien.adb a-colien.ads a-colire.adb
+ a-colire.ads a-comlin.adb a-comlin.ads a-cwila1.ads
+ a-decima.adb a-decima.ads a-diocst.adb a-diocst.ads
+ a-direio.adb a-direio.ads a-einuoc.adb a-einuoc.ads
+ a-except.adb a-except.ads a-excpol.adb a-exctra.adb
+ a-exctra.ads a-filico.adb a-filico.ads a-finali.adb
+ a-finali.ads a-interr.ads a-intsig.adb a-intsig.ads
+ a-ngcefu.adb a-ngcoty.adb a-ngcoty.ads a-ngelfu.adb
+ a-nudira.adb a-nudira.ads a-nuflra.adb a-nuflra.ads
+ a-numaux.ads a-reatim.ads a-retide.ads a-sequio.adb
+ a-sequio.ads a-siocst.adb a-siocst.ads a-ssicst.adb
+ a-ssicst.ads a-stmaco.ads a-storio.adb a-strbou.adb
+ a-strbou.ads a-stream.ads a-strfix.adb a-strfix.ads
+ a-strmap.adb a-strmap.ads a-strsea.adb a-strsea.ads
+ a-strunb.adb a-strunb.ads a-ststio.adb a-ststio.ads
+ a-stunau.adb a-stunau.ads a-stwibo.adb a-stwibo.ads
+ a-stwifi.adb a-stwima.adb a-stwima.ads a-stwise.adb
+ a-stwise.ads a-stwiun.adb a-stwiun.ads a-suteio.adb
+ a-suteio.ads a-swmwco.ads a-swuwti.adb a-swuwti.ads
+ a-sytaco.adb a-sytaco.ads a-tags.adb a-tags.ads a-tasatt.ads
+ a-taside.adb a-taside.ads a-teioed.adb a-teioed.ads
+ a-textio.adb a-textio.ads a-ticoau.adb a-ticoau.ads
+ a-ticoio.adb a-ticoio.ads a-tideau.adb a-tideau.ads
+ a-tideio.adb a-tideio.ads a-tienau.adb a-tienau.ads
+ a-tienio.adb a-tienio.ads a-tifiio.adb a-tifiio.ads
+ a-tiflau.adb a-tiflau.ads a-tiflio.adb a-tiflio.ads
+ a-tigeau.adb a-tigeau.ads a-tiinau.adb a-tiinau.ads
+ a-tiinio.adb a-tiinio.ads a-timoau.adb a-timoau.ads
+ a-timoio.adb a-timoio.ads a-tiocst.adb a-tiocst.ads
+ a-titest.adb a-witeio.adb a-witeio.ads a-wtcoau.adb
+ a-wtcoau.ads a-wtcoio.adb a-wtcstr.adb a-wtcstr.ads
+ a-wtdeau.adb a-wtdeau.ads a-wtdeio.adb a-wtdeio.ads
+ a-wtedit.adb a-wtedit.ads a-wtenau.adb a-wtenau.ads
+ a-wtenio.adb a-wtenio.ads a-wtfiio.adb a-wtfiio.ads
+ a-wtflau.adb a-wtflau.ads a-wtflio.adb a-wtflio.ads
+ a-wtgeau.adb a-wtgeau.ads a-wtinau.adb a-wtinau.ads
+ a-wtinio.adb a-wtmoau.adb a-wtmoau.ads a-wtmoio.adb
+ a-wtmoio.ads a-wttest.adb ada-tree.def ada-tree.h ada.h
+ adaint.c adaint.h ali-util.adb ali-util.ads ali.adb ali.ads
+ alloc.ads argv.c atree.adb atree.ads atree.h back_end.adb
+ back_end.ads bcheck.adb bcheck.ads binde.adb binde.ads
+ binderr.adb binderr.ads bindgen.adb bindgen.ads bindusg.adb
+ bindusg.ads butil.adb butil.ads cal.c casing.adb casing.ads
+ ceinfo.adb checks.adb checks.ads cio.c comperr.adb comperr.ads
+ csets.adb csets.ads csinfo.adb cstand.adb cstand.ads
+ cstreams.c cuintp.c debug.adb debug.ads debug_a.adb
+ debug_a.ads dec-io.adb dec-io.ads dec.ads decl.c deftarg.c
+ einfo.adb einfo.ads einfo.h elists.adb elists.ads elists.h
+ errno.c errout.adb errout.ads eval_fat.adb eval_fat.ads exit.c
+ exp_aggr.adb exp_aggr.ads exp_attr.adb exp_attr.ads
+ exp_ch10.ads exp_ch11.adb exp_ch11.ads exp_ch12.adb
+ exp_ch12.ads exp_ch13.adb exp_ch13.ads exp_ch2.adb exp_ch2.ads
+ exp_ch3.adb exp_ch3.ads exp_ch4.adb exp_ch4.ads exp_ch5.adb
+ exp_ch5.ads exp_ch6.adb exp_ch6.ads exp_ch7.adb exp_ch7.ads
+ exp_ch8.adb exp_ch8.ads exp_ch9.adb exp_ch9.ads exp_code.adb
+ exp_code.ads exp_dbug.adb exp_dbug.ads exp_disp.adb
+ exp_disp.ads exp_dist.adb exp_dist.ads exp_fixd.adb
+ exp_fixd.ads exp_imgv.adb exp_imgv.ads exp_intr.adb
+ exp_intr.ads exp_pakd.adb exp_pakd.ads exp_prag.adb
+ exp_prag.ads exp_smem.adb exp_smem.ads exp_strm.adb
+ exp_strm.ads exp_tss.adb exp_tss.ads exp_util.adb exp_util.ads
+ exp_vfpt.adb exp_vfpt.ads expander.adb expander.ads fe.h
+ final.c fmap.adb fmap.ads fname-sf.adb fname-sf.ads
+ fname-uf.adb fname-uf.ads fname.adb fname.ads freeze.adb
+ freeze.ads frontend.adb frontend.ads g-calend.ads g-comlin.adb
+ g-debpoo.adb g-debpoo.ads g-locfil.adb g-os_lib.ads
+ g-regist.adb g-regist.ads get_targ.adb get_targ.ads gigi.h
+ gmem.c gnat1drv.adb gnat1drv.ads gnat_ug.texi gnatbind.adb
+ gnatbind.ads gnatbl.c gnatcmd.adb gnatcmd.ads gnatdll.adb
+ gnatfind.adb gnatkr.adb gnatkr.ads gnatlbr.adb gnatlink.adb
+ gnatlink.ads gnatls.adb gnatls.ads gnatmake.adb gnatmake.ads
+ gnatmem.adb gnatprep.adb gnatprep.ads gnatpsta.adb gnatvsn.ads
+ gnatxref.adb hlo.adb hlo.ads hostparm.ads i-c.adb i-cexten.ads
+ i-cobol.adb i-cobol.ads i-cpoint.adb i-cpoint.ads i-cpp.adb
+ i-cpp.ads i-cstrea.adb i-cstrea.ads i-cstrin.adb i-cstrin.ads
+ i-fortra.adb i-os2err.ads i-os2lib.adb i-os2lib.ads
+ i-os2syn.ads i-os2thr.ads i-pacdec.adb i-pacdec.ads
+ impunit.adb impunit.ads init.c inline.adb inline.ads io-aux.c
+ itypes.adb itypes.ads krunch.adb krunch.ads lang-options.h
+ lang-specs.h layout.adb layout.ads lib-list.adb lib-load.adb
+ lib-load.ads lib-sort.adb lib-util.adb lib-util.ads
+ lib-writ.adb lib-writ.ads lib-xref.adb lib-xref.ads lib.adb
+ lib.ads link.c live.adb live.ads make.adb make.ads makeusg.adb
+ makeusg.ads math_lib.adb mdll.adb mdll.ads memtrack.adb misc.c
+ namet.adb namet.ads namet.h nlists.adb nlists.ads nlists.h
+ nmake.adb nmake.ads nmake.adt opt.adb opt.ads osint.adb
+ osint.ads output.adb output.ads par-ch10.adb par-ch11.adb
+ par-ch12.adb par-ch13.adb par-ch2.adb par-ch3.adb par-ch4.adb
+ par-ch5.adb par-ch6.adb par-ch7.adb par-ch8.adb par-ch9.adb
+ par-endh.adb par-labl.adb par-load.adb par-prag.adb
+ par-sync.adb par-tchk.adb par-util.adb par.adb par.ads
+ prj-attr.adb prj-attr.ads prj-com.adb prj-com.ads prj-dect.adb
+ prj-dect.ads prj-env.adb prj-env.ads prj-ext.adb prj-ext.ads
+ prj-nmsc.adb prj-nmsc.ads prj-pars.adb prj-pars.ads
+ prj-part.adb prj-part.ads prj-proc.adb prj-proc.ads
+ prj-strt.adb prj-strt.ads prj-tree.adb prj-tree.ads
+ prj-util.adb prj-util.ads prj.adb prj.ads raise.c raise.h
+ repinfo.adb repinfo.ads repinfo.h restrict.adb restrict.ads
+ rident.ads rtsfind.adb rtsfind.ads s-addima.adb s-addima.ads
+ s-arit64.adb s-arit64.ads s-assert.adb s-assert.ads
+ s-asthan.adb s-asthan.ads s-atacco.adb s-auxdec.adb
+ s-auxdec.ads s-bitops.adb s-bitops.ads s-chepoo.ads
+ s-direio.adb s-direio.ads s-except.ads s-exctab.adb
+ s-exctab.ads s-exnflt.ads s-exngen.adb s-exngen.ads
+ s-exnint.ads s-exnlfl.ads s-exnlin.ads s-exnllf.ads
+ s-exnlli.ads s-exnsfl.ads s-exnsin.ads s-exnssi.ads
+ s-expflt.ads s-expgen.adb s-expgen.ads s-expint.ads
+ s-explfl.ads s-explin.ads s-expllf.ads s-explli.ads
+ s-expllu.adb s-expllu.ads s-expmod.adb s-expmod.ads
+ s-expsfl.ads s-expsin.ads s-expssi.ads s-expuns.adb
+ s-expuns.ads s-fatflt.ads s-fatgen.adb s-fatgen.ads
+ s-fatlfl.ads s-fatllf.ads s-fatsfl.ads s-ficobl.ads
+ s-fileio.adb s-fileio.ads s-finimp.adb s-finimp.ads
+ s-finroo.adb s-finroo.ads s-fore.adb s-fore.ads s-imgbiu.adb
+ s-imgbiu.ads s-imgboo.adb s-imgboo.ads s-imgcha.adb
+ s-imgcha.ads s-imgdec.adb s-imgdec.ads s-imgenu.adb
+ s-imgenu.ads s-imgint.adb s-imgint.ads s-imgllb.adb
+ s-imgllb.ads s-imglld.adb s-imglld.ads s-imglli.adb
+ s-imglli.ads s-imgllu.adb s-imgllu.ads s-imgllw.adb
+ s-imgllw.ads s-imgrea.adb s-imgrea.ads s-imguns.adb
+ s-imguns.ads s-imgwch.adb s-imgwch.ads s-imgwiu.adb
+ s-imgwiu.ads s-inmaop.ads s-interr.adb s-interr.ads
+ s-intman.ads s-io.adb s-io.ads s-maccod.ads s-mantis.adb
+ s-mantis.ads s-memory.adb s-memory.ads s-osprim.ads
+ s-pack03.adb s-pack03.ads s-pack05.adb s-pack05.ads
+ s-pack06.adb s-pack06.ads s-pack07.adb s-pack07.ads
+ s-pack09.adb s-pack09.ads s-pack10.adb s-pack10.ads
+ s-pack11.adb s-pack11.ads s-pack12.adb s-pack12.ads
+ s-pack13.adb s-pack13.ads s-pack14.adb s-pack14.ads
+ s-pack15.adb s-pack15.ads s-pack17.adb s-pack17.ads
+ s-pack18.adb s-pack18.ads s-pack19.adb s-pack19.ads
+ s-pack20.adb s-pack20.ads s-pack21.adb s-pack21.ads
+ s-pack22.adb s-pack22.ads s-pack23.adb s-pack23.ads
+ s-pack24.adb s-pack24.ads s-pack25.adb s-pack25.ads
+ s-pack26.adb s-pack26.ads s-pack27.adb s-pack27.ads
+ s-pack28.adb s-pack28.ads s-pack29.adb s-pack29.ads
+ s-pack30.adb s-pack30.ads s-pack31.adb s-pack31.ads
+ s-pack33.adb s-pack33.ads s-pack34.adb s-pack34.ads
+ s-pack35.adb s-pack35.ads s-pack36.adb s-pack36.ads
+ s-pack37.adb s-pack37.ads s-pack38.adb s-pack38.ads
+ s-pack39.adb s-pack39.ads s-pack40.adb s-pack40.ads
+ s-pack41.adb s-pack41.ads s-pack42.adb s-pack42.ads
+ s-pack43.adb s-pack43.ads s-pack44.adb s-pack44.ads
+ s-pack45.adb s-pack45.ads s-pack46.adb s-pack46.ads
+ s-pack47.adb s-pack47.ads s-pack48.adb s-pack48.ads
+ s-pack49.adb s-pack49.ads s-pack50.adb s-pack50.ads
+ s-pack51.adb s-pack51.ads s-pack52.adb s-pack52.ads
+ s-pack53.adb s-pack53.ads s-pack54.adb s-pack54.ads
+ s-pack55.adb s-pack55.ads s-pack56.adb s-pack56.ads
+ s-pack57.adb s-pack57.ads s-pack58.adb s-pack58.ads
+ s-pack59.adb s-pack59.ads s-pack60.adb s-pack60.ads
+ s-pack61.adb s-pack61.ads s-pack62.adb s-pack62.ads
+ s-pack63.adb s-pack63.ads s-parame.adb s-parame.ads
+ s-parint.adb s-parint.ads s-pooglo.adb s-pooglo.ads
+ s-pooloc.adb s-pooloc.ads s-poosiz.adb s-poosiz.ads
+ s-powtab.ads s-proinf.adb s-proinf.ads s-rpc.adb s-rpc.ads
+ s-scaval.ads s-secsta.adb s-secsta.ads s-sequio.adb
+ s-sequio.ads s-shasto.adb s-shasto.ads s-soflin.adb
+ s-soflin.ads s-sopco3.adb s-sopco3.ads s-sopco4.adb
+ s-sopco4.ads s-sopco5.adb s-sopco5.ads s-stache.adb
+ s-stache.ads s-stalib.adb s-stalib.ads s-stoele.adb
+ s-stopoo.ads s-stratt.adb s-stratt.ads s-strops.adb
+ s-strops.ads s-taprob.ads s-taprop.ads s-tarest.ads
+ s-tasdeb.adb s-tasdeb.ads s-tasinf.adb s-tasinf.ads
+ s-tasini.ads s-taskin.ads s-tasren.ads s-tasres.ads
+ s-tassta.ads s-tpinop.adb s-tpinop.ads s-tpoben.ads
+ s-tpobop.ads s-unstyp.ads s-vaflop.adb s-vaflop.ads
+ s-valboo.adb s-valboo.ads s-valcha.adb s-valcha.ads
+ s-valdec.adb s-valdec.ads s-valenu.adb s-valenu.ads
+ s-valint.adb s-valint.ads s-vallld.adb s-vallld.ads
+ s-vallli.adb s-vallli.ads s-valllu.adb s-valllu.ads
+ s-valrea.adb s-valrea.ads s-valuns.adb s-valuns.ads
+ s-valuti.adb s-valuti.ads s-valwch.adb s-valwch.ads
+ s-vercon.adb s-vercon.ads s-vmexta.adb s-vmexta.ads
+ s-wchcnv.adb s-wchcnv.ads s-wchcon.ads s-wchjis.adb
+ s-wchjis.ads s-wchstw.adb s-wchstw.ads s-wchwts.adb
+ s-wchwts.ads s-widboo.adb s-widboo.ads s-widcha.adb
+ s-widcha.ads s-widenu.adb s-widenu.ads s-widlli.adb
+ s-widlli.ads s-widllu.adb s-widllu.ads s-widwch.adb
+ s-widwch.ads s-wwdcha.adb s-wwdcha.ads s-wwdenu.adb
+ s-wwdenu.ads s-wwdwch.adb s-wwdwch.ads scans.adb scans.ads
+ scn-nlit.adb scn-slit.adb scn.adb scn.ads sdefault.ads sem.adb
+ sem.ads sem_aggr.adb sem_aggr.ads sem_attr.adb sem_attr.ads
+ sem_case.adb sem_case.ads sem_cat.adb sem_cat.ads sem_ch10.adb
+ sem_ch10.ads sem_ch11.adb sem_ch11.ads sem_ch12.adb
+ sem_ch12.ads sem_ch13.adb sem_ch13.ads sem_ch2.adb sem_ch2.ads
+ sem_ch3.adb sem_ch3.ads sem_ch4.adb sem_ch4.ads sem_ch5.adb
+ sem_ch5.ads sem_ch6.adb sem_ch6.ads sem_ch7.adb sem_ch7.ads
+ sem_ch8.adb sem_ch8.ads sem_ch9.adb sem_ch9.ads sem_disp.adb
+ sem_disp.ads sem_dist.adb sem_dist.ads sem_elab.adb
+ sem_elab.ads sem_elim.adb sem_elim.ads sem_eval.adb
+ sem_eval.ads sem_intr.adb sem_intr.ads sem_maps.adb
+ sem_maps.ads sem_mech.adb sem_mech.ads sem_prag.adb
+ sem_prag.ads sem_res.adb sem_res.ads sem_smem.adb sem_smem.ads
+ sem_type.adb sem_type.ads sem_util.adb sem_util.ads
+ sem_vfpt.adb sem_vfpt.ads sem_warn.adb sem_warn.ads
+ sfn_scan.adb sfn_scan.ads sinfo-cn.adb sinfo-cn.ads sinfo.adb
+ sinfo.ads sinfo.h sinput-l.adb sinput-l.ads sinput-p.adb
+ sinput-p.ads sinput.adb sinput.ads snames.adb snames.ads
+ snames.h sprint.adb sprint.ads stand.adb stand.ads stringt.adb
+ stringt.ads stringt.h style.adb style.ads stylesw.adb
+ stylesw.ads switch.adb switch.ads sysdep.c system.ads
+ table.adb table.ads targparm.adb targparm.ads targtyps.c
+ tbuild.adb tbuild.ads trans.c tree_gen.adb tree_gen.ads
+ tree_in.adb tree_in.ads tree_io.adb tree_io.ads treepr.adb
+ treepr.ads treeprs.ads treeprs.adt ttypef.ads ttypes.ads
+ types.adb types.ads types.h uintp.adb uintp.ads uintp.h
+ uname.adb uname.ads urealp.adb urealp.ads urealp.h usage.adb
+ usage.ads utils.c utils2.c validsw.adb validsw.ads
+ widechar.adb widechar.ads xeinfo.adb xnmake.adb xr_tabls.adb
+ xr_tabls.ads xref_lib.adb xref_lib.ads xsinfo.adb xsnames.adb
xtreeprs.adb: Correct statements in comments about maintainership
of GNAT.
diff --git a/gcc/ada/Make-lang.in b/gcc/ada/Make-lang.in
index 6669eb4c64f..d7a6aff87b5 100644
--- a/gcc/ada/Make-lang.in
+++ b/gcc/ada/Make-lang.in
@@ -972,14 +972,13 @@ ada/memtrack.o : ada/memtrack.adb ada/s-memory.ads
$(ADAC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 \
$(ADA_INCLUDES) $< $(OUTPUT_OPTION)
-ada/adadecode.o : ada/adadecode.c ada/adadecode.h $(CONFIG_H) $(SYSTEM_H) \
- ada/adadecode.h
-ada/adaint.o : ada/adaint.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h
-ada/argv.o : ada/argv.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h
+ada/adadecode.o : ada/adadecode.c $(CONFIG_H) $(SYSTEM_H) ada/adadecode.h
+ada/adaint.o : ada/adaint.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h
+ada/argv.o : ada/argv.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h
ada/cstreams.o : ada/cstreams.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h
-ada/exit.o : ada/exit.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h
-ada/final.o : ada/final.c $(CONFIG_H) $(SYSTEM_H) ada/raise.h
-ada/link.o : ada/link.c
+ada/exit.o : ada/exit.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h
+ada/final.o : ada/final.c $(CONFIG_H) $(SYSTEM_H) ada/raise.h
+ada/link.o : ada/link.c
ada/cio.o : ada/cio.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h
$(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) $(RT_FLAGS) \
@@ -999,44 +998,41 @@ ada/tracebak.o : ada/tracebak.c $(CONFIG_H) $(SYSTEM_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-fno-omit-frame-pointer $< $(OUTPUT_OPTION)
-ada/cuintp.o : ada/cuintp.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) ada/ada.h \
- ada/types.h ada/uintp.h ada/atree.h ada/stringt.h ada/elists.h \
+ada/cuintp.o : ada/cuintp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ ada/ada.h ada/types.h ada/uintp.h ada/atree.h ada/stringt.h ada/elists.h \
ada/nlists.h ada/fe.h ada/gigi.h
-ada/decl.o : ada/decl.c $(CONFIG_H) $(TREE_H) $(srcdir)/flags.h \
- $(srcdir)/toplev.h $(srcdir)/convert.h ada/ada.h ada/types.h ada/atree.h \
- ada/nlists.h ada/elists.h ada/uintp.h ada/sinfo.h ada/einfo.h ada/snames.h \
- ada/namet.h ada/stringt.h ada/repinfo.h ada/fe.h $(ADA_TREE_H) ada/gigi.h \
- gt-ada-decl.h
-
-ada/misc.o : ada/misc.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(srcdir)/expr.h \
- insn-codes.h insn-flags.h insn-config.h $(srcdir)/recog.h \
- $(srcdir)/flags.h $(srcdir)/diagnostic.h $(srcdir)/output.h \
- $(srcdir)/except.h tm_p.h $(srcdir)/langhooks.h $(srcdir)/debug.h \
- $(srcdir)/langhooks-def.h $(srcdir)/libfuncs.h $(srcdir)/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
-
-ada/targtyps.o : ada/targtyps.c $(CONFIG_H) ada/ada.h ada/types.h ada/atree.h \
- ada/nlists.h ada/elists.h ada/uintp.h ada/sinfo.h ada/einfo.h ada/namet.h \
- ada/snames.h ada/stringt.h ada/urealp.h ada/fe.h $(ADA_TREE_H) ada/gigi.h
-
-ada/trans.o : ada/trans.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(srcdir)/flags.h \
- ada/ada.h $(srcdir)/except.h ada/types.h ada/atree.h ada/nlists.h \
+ada/decl.o : ada/decl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ flags.h toplev.h convert.h ada/ada.h ada/types.h ada/atree.h ada/nlists.h \
+ ada/elists.h ada/uintp.h ada/sinfo.h ada/einfo.h ada/snames.h ada/namet.h \
+ ada/stringt.h ada/repinfo.h ada/fe.h $(ADA_TREE_H) ada/gigi.h gt-ada-decl.h
+
+ada/misc.o : ada/misc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ $(RTL_H) expr.h insn-codes.h insn-flags.h insn-config.h recog.h flags.h \
+ diagnostic.h output.h except.h $(TM_P_H) langhooks.h debug.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
+
+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 \
+ ada/sinfo.h ada/einfo.h ada/namet.h ada/snames.h ada/stringt.h ada/urealp.h \
+ ada/fe.h $(ADA_TREE_H) ada/gigi.h
+
+ada/trans.o : ada/trans.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ $(RTL_H) flags.h ada/ada.h except.h ada/types.h ada/atree.h ada/nlists.h \
ada/elists.h ada/uintp.h ada/sinfo.h ada/einfo.h ada/namet.h ada/snames.h \
ada/stringt.h ada/urealp.h ada/fe.h $(ADA_TREE_H) ada/gigi.h gt-ada-trans.h
-ada/utils.o : ada/utils.c $(CONFIG_H) $(TREE_H) $(srcdir)/flags.h \
- $(srcdir)/expr.h $(srcdir)/convert.h $(srcdir)/defaults.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 \
- gt-ada-utils.h gtype-ada.h
+ada/utils.o : ada/utils.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ flags.h expr.h convert.h defaults.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 gt-ada-utils.h gtype-ada.h
-ada/utils2.o : ada/utils2.c $(CONFIG_H) $(TREE_H) $(srcdir)/flags.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/snames.h ada/stringt.h ada/uintp.h ada/fe.h $(ADA_TREE_H) \
- ada/gigi.h
+ada/utils2.o : ada/utils2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(TREE_H) flags.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/snames.h ada/stringt.h \
+ ada/uintp.h ada/fe.h $(ADA_TREE_H) ada/gigi.h
#
# DO NOT PUT SPECIAL RULES BELOW, THIS SECTION IS UPDATED AUTOMATICALLY
diff --git a/gcc/ada/cuintp.c b/gcc/ada/cuintp.c
index e390cfcec85..d5eeb2d2ce1 100644
--- a/gcc/ada/cuintp.c
+++ b/gcc/ada/cuintp.c
@@ -30,6 +30,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "ada.h"
#include "types.h"
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index 8a2e6017527..adf648111b3 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -27,6 +27,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "flags.h"
#include "toplev.h"
diff --git a/gcc/ada/deftarg.c b/gcc/ada/deftarg.c
index 9640b65c6fd..d69ce227188 100644
--- a/gcc/ada/deftarg.c
+++ b/gcc/ada/deftarg.c
@@ -34,6 +34,8 @@
/* Include a default definition for TARGET_FLAGS for gnatpsta. */
#include "config.h"
-#define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
int target_flags = TARGET_DEFAULT;
diff --git a/gcc/ada/lang-specs.h b/gcc/ada/lang-specs.h
index 4f2dfeb5006..1c41f87d56a 100644
--- a/gcc/ada/lang-specs.h
+++ b/gcc/ada/lang-specs.h
@@ -31,12 +31,13 @@
{".ads", "@ada", 0},
{".adb", "@ada", 0},
{"@ada",
- "gnat1 %{^I*} %{k8:-gnatk8} %{w:-gnatws} %1 %{!Q:-quiet} %{nostdinc*}\
+ "\
+ %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
+ %{!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*}\
-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}} \
- %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
- %i %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
- %{!S:%{!gnatc:%{!gnatz:%{!gnats:as %a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}\
- %{!c:%e-c or -S required for Ada}\
- %{!pipe:%g.s} %A\n}}}} ", 0},
+ %i %{S:%W{o*}%{!o*:-o %b.s}} \
+ %{!gnatc:%{!gnatz:%{!gnats:%(invoke_as)}}}", 0},
diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c
index ad431066343..a8293e709fb 100644
--- a/gcc/ada/misc.c
+++ b/gcc/ada/misc.c
@@ -37,6 +37,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "errors.h"
@@ -207,8 +209,8 @@ gnat_parse_file (set_yydebug)
/* Decode all the language specific options that cannot be decoded by GCC.
The option decoding phase of GCC calls this routine on the flags that
- it cannot decode. This routine returns 1 if it is successful, otherwise
- it returns 0. */
+ it cannot decode. This routine returns the number of consecutive arguments
+ from ARGV that it successfully decoded; 0 indicates failure. */
static int
gnat_decode_option (argc, argv)
@@ -220,10 +222,28 @@ gnat_decode_option (argc, argv)
if (!strncmp (p, "-I", 2))
{
- /* Pass the -I switches as-is. */
- gnat_argv[gnat_argc] = p;
- gnat_argc ++;
- return 1;
+ /* We might get -I foo or -Ifoo. Canonicalize to the latter. */
+ if (p[2] == '\0')
+ {
+ char *q;
+
+ if (argv[1] == 0)
+ return 0;
+
+ q = xmalloc (sizeof("-I") + strlen (argv[1]));
+ strcpy (q, "-I");
+ strcat (q, argv[1]);
+
+ gnat_argv[gnat_argc] = q;
+ gnat_argc ++;
+ return 2; /* consumed argument */
+ }
+ else
+ {
+ gnat_argv[gnat_argc] = p;
+ gnat_argc ++;
+ return 1;
+ }
}
else if (!strncmp (p, "-gant", 5))
diff --git a/gcc/ada/targtyps.c b/gcc/ada/targtyps.c
index 76b71cbb679..39a009b0e94 100644
--- a/gcc/ada/targtyps.c
+++ b/gcc/ada/targtyps.c
@@ -35,6 +35,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "real.h"
#include "rtl.h"
diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c
index 68ebacc735c..68bb09ed4e9 100644
--- a/gcc/ada/trans.c
+++ b/gcc/ada/trans.c
@@ -27,6 +27,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "real.h"
#include "flags.h"
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index c352186b15b..a5d2860652f 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -27,6 +27,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "flags.h"
#include "defaults.h"
diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c
index 4d4cb60ac91..3777a5b2cdd 100644
--- a/gcc/ada/utils2.c
+++ b/gcc/ada/utils2.c
@@ -27,6 +27,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "flags.h"
#include "ada.h"
diff --git a/gcc/alias.c b/gcc/alias.c
index 45e868ca963..12029f053cd 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "tm_p.h"
diff --git a/gcc/attribs.c b/gcc/attribs.c
index c5a8a73026b..313ebbf5243 100644
--- a/gcc/attribs.c
+++ b/gcc/attribs.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "flags.h"
#include "toplev.h"
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index 10c895408f2..a72b9b9dc3c 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -112,7 +112,11 @@ do { \
be done, other than zero the statistics on the first allocation. */
#define MAX_REGNO_REG_SET(NUM_REGS, NEW_P, RENUMBER_P)
-/* Type we use to hold basic block counters. Should be at least 64bit. */
+/* Type we use to hold basic block counters. Should be at least
+ 64bit. Although a counter cannot be negative, we use a signed
+ type, because erroneous negative counts can be generated when the
+ flow graph is manipulated by various optimizations. A signed type
+ makes those easy to detect. */
typedef HOST_WIDEST_INT gcov_type;
/* Control flow edge information. */
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 24c41e51ced..3933c725a86 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -82,6 +82,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "hard-reg-set.h"
diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index e2b58c0e0c8..7b93eab88a2 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -20,6 +20,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "flags.h"
#include "obstack.h"
diff --git a/gcc/builtins.c b/gcc/builtins.c
index aa0cfaf8dd1..7c9d999979e 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "machmode.h"
#include "real.h"
#include "rtl.h"
@@ -150,7 +152,6 @@ static tree fold_builtin_constant_p PARAMS ((tree));
static tree fold_builtin_classify_type PARAMS ((tree));
static tree fold_builtin_inf PARAMS ((tree, int));
static tree fold_builtin_nan PARAMS ((tree, tree, int));
-static tree build_function_call_expr PARAMS ((tree, tree));
static int validate_arglist PARAMS ((tree, ...));
/* Return the alignment in bits of EXP, a pointer valued expression.
@@ -1484,6 +1485,7 @@ expand_builtin_mathfn (exp, target, subtarget)
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
tree arglist = TREE_OPERAND (exp, 1);
enum machine_mode argmode;
+ bool errno_set = true;
if (!validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
return 0;
@@ -1534,6 +1536,26 @@ expand_builtin_mathfn (exp, target, subtarget)
case BUILT_IN_LOGF:
case BUILT_IN_LOGL:
builtin_optab = log_optab; break;
+ case BUILT_IN_FLOOR:
+ case BUILT_IN_FLOORF:
+ case BUILT_IN_FLOORL:
+ errno_set = false ; builtin_optab = floor_optab; break;
+ case BUILT_IN_CEIL:
+ case BUILT_IN_CEILF:
+ case BUILT_IN_CEILL:
+ errno_set = false ; builtin_optab = ceil_optab; break;
+ case BUILT_IN_TRUNC:
+ case BUILT_IN_TRUNCF:
+ case BUILT_IN_TRUNCL:
+ errno_set = false ; builtin_optab = trunc_optab; break;
+ case BUILT_IN_ROUND:
+ case BUILT_IN_ROUNDF:
+ case BUILT_IN_ROUNDL:
+ errno_set = false ; builtin_optab = round_optab; break;
+ case BUILT_IN_NEARBYINT:
+ case BUILT_IN_NEARBYINTF:
+ case BUILT_IN_NEARBYINTL:
+ errno_set = false ; builtin_optab = nearbyint_optab; break;
default:
abort ();
}
@@ -1554,7 +1576,7 @@ expand_builtin_mathfn (exp, target, subtarget)
/* If errno must be maintained, we must set it to EDOM for NaN results. */
- if (flag_errno_math && HONOR_NANS (argmode))
+ if (flag_errno_math && errno_set && HONOR_NANS (argmode))
{
rtx lab1;
@@ -3744,6 +3766,21 @@ expand_builtin (exp, target, subtarget, mode, ignore)
case BUILT_IN_FPUTC_UNLOCKED:
case BUILT_IN_FPUTS_UNLOCKED:
case BUILT_IN_FWRITE_UNLOCKED:
+ case BUILT_IN_FLOOR:
+ case BUILT_IN_FLOORF:
+ case BUILT_IN_FLOORL:
+ case BUILT_IN_CEIL:
+ case BUILT_IN_CEILF:
+ case BUILT_IN_CEILL:
+ case BUILT_IN_TRUNC:
+ case BUILT_IN_TRUNCF:
+ case BUILT_IN_TRUNCL:
+ case BUILT_IN_ROUND:
+ case BUILT_IN_ROUNDF:
+ case BUILT_IN_ROUNDL:
+ case BUILT_IN_NEARBYINT:
+ case BUILT_IN_NEARBYINTF:
+ case BUILT_IN_NEARBYINTL:
return expand_call (exp, target, ignore);
default:
@@ -3794,6 +3831,21 @@ expand_builtin (exp, target, subtarget, mode, ignore)
case BUILT_IN_SQRT:
case BUILT_IN_SQRTF:
case BUILT_IN_SQRTL:
+ case BUILT_IN_FLOOR:
+ case BUILT_IN_FLOORF:
+ case BUILT_IN_FLOORL:
+ case BUILT_IN_CEIL:
+ case BUILT_IN_CEILF:
+ case BUILT_IN_CEILL:
+ case BUILT_IN_TRUNC:
+ case BUILT_IN_TRUNCF:
+ case BUILT_IN_TRUNCL:
+ case BUILT_IN_ROUND:
+ case BUILT_IN_ROUNDF:
+ case BUILT_IN_ROUNDL:
+ case BUILT_IN_NEARBYINT:
+ case BUILT_IN_NEARBYINTF:
+ case BUILT_IN_NEARBYINTL:
target = expand_builtin_mathfn (exp, target, subtarget);
if (target)
return target;
@@ -4080,6 +4132,37 @@ expand_builtin (exp, target, subtarget, mode, ignore)
return expand_call (exp, target, ignore);
}
+/* Determine whether a tree node represents a call to a built-in
+ math function. If the tree T is a call to a built-in function
+ taking a single real argument, then the return value is the
+ DECL_FUNCTION_CODE of the call, e.g. BUILT_IN_SQRT. Otherwise
+ the return value is END_BUILTINS. */
+
+enum built_in_function
+builtin_mathfn_code (t)
+ tree t;
+{
+ tree fndecl, arglist;
+
+ if (TREE_CODE (t) != CALL_EXPR
+ || TREE_CODE (TREE_OPERAND (t, 0)) != ADDR_EXPR)
+ return END_BUILTINS;
+
+ fndecl = TREE_OPERAND (TREE_OPERAND (t, 0), 0);
+ if (TREE_CODE (fndecl) != FUNCTION_DECL
+ || ! DECL_BUILT_IN (fndecl)
+ || DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
+ return END_BUILTINS;
+
+ arglist = TREE_OPERAND (t, 1);
+ if (! arglist
+ || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != REAL_TYPE
+ || TREE_CHAIN (arglist))
+ return END_BUILTINS;
+
+ return DECL_FUNCTION_CODE (fndecl);
+}
+
/* Fold a call to __builtin_constant_p, if we know it will evaluate to a
constant. ARGLIST is the argument list of the call. */
@@ -4208,6 +4291,103 @@ fold_builtin (exp)
}
break;
+ case BUILT_IN_SQRT:
+ case BUILT_IN_SQRTF:
+ case BUILT_IN_SQRTL:
+ if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
+ {
+ enum built_in_function fcode;
+ tree arg = TREE_VALUE (arglist);
+
+ /* Optimize sqrt of constant value. */
+ if (TREE_CODE (arg) == REAL_CST
+ && ! TREE_CONSTANT_OVERFLOW (arg))
+ {
+ enum machine_mode mode;
+ REAL_VALUE_TYPE r, x;
+
+ x = TREE_REAL_CST (arg);
+ mode = TYPE_MODE (TREE_TYPE (arg));
+ if (!HONOR_SNANS (mode) || !real_isnan (&x))
+ {
+ real_sqrt (&r, mode, &x);
+ return build_real (TREE_TYPE (arg), r);
+ }
+ }
+
+ /* Optimize sqrt(exp(x)) = exp(x/2.0). */
+ fcode = builtin_mathfn_code (arg);
+ if (flag_unsafe_math_optimizations
+ && (fcode == BUILT_IN_EXP
+ || fcode == BUILT_IN_EXPF
+ || fcode == BUILT_IN_EXPL))
+ {
+ tree expfn = TREE_OPERAND (TREE_OPERAND (arg, 0), 0);
+ arg = build (RDIV_EXPR, TREE_TYPE (arg),
+ TREE_VALUE (TREE_OPERAND (arg, 1)),
+ build_real (TREE_TYPE (arg), dconst2));
+ arglist = build_tree_list (NULL_TREE, arg);
+ return build_function_call_expr (expfn, arglist);
+ }
+ }
+ break;
+
+ case BUILT_IN_EXP:
+ case BUILT_IN_EXPF:
+ case BUILT_IN_EXPL:
+ if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
+ {
+ enum built_in_function fcode;
+ tree arg = TREE_VALUE (arglist);
+
+ /* Optimize exp(0.0) = 1.0. */
+ if (real_zerop (arg))
+ return build_real (TREE_TYPE (arg), dconst1);
+
+ /* Optimize exp(log(x)) = x. */
+ fcode = builtin_mathfn_code (arg);
+ if (flag_unsafe_math_optimizations
+ && (fcode == BUILT_IN_LOG
+ || fcode == BUILT_IN_LOGF
+ || fcode == BUILT_IN_LOGL))
+ return TREE_VALUE (TREE_OPERAND (arg, 1));
+ }
+ break;
+
+ case BUILT_IN_LOG:
+ case BUILT_IN_LOGF:
+ case BUILT_IN_LOGL:
+ if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
+ {
+ enum built_in_function fcode;
+ tree arg = TREE_VALUE (arglist);
+
+ /* Optimize log(1.0) = 0.0. */
+ if (real_onep (arg))
+ return build_real (TREE_TYPE (arg), dconst0);
+
+ /* Optimize log(exp(x)) = x. */
+ fcode = builtin_mathfn_code (arg);
+ if (flag_unsafe_math_optimizations
+ && (fcode == BUILT_IN_EXP
+ || fcode == BUILT_IN_EXPF
+ || fcode == BUILT_IN_EXPL))
+ return TREE_VALUE (TREE_OPERAND (arg, 1));
+
+ /* Optimize log(sqrt(x)) = log(x)/2.0. */
+ if (flag_unsafe_math_optimizations
+ && (fcode == BUILT_IN_SQRT
+ || fcode == BUILT_IN_SQRTF
+ || fcode == BUILT_IN_SQRTL))
+ {
+ tree logfn = build_function_call_expr (fndecl,
+ TREE_OPERAND (arg, 1));
+ return fold (build (RDIV_EXPR, TREE_TYPE (arg), logfn,
+ build_real (TREE_TYPE (arg), dconst2)));
+ }
+ }
+ break;
+
case BUILT_IN_INF:
case BUILT_IN_INFF:
case BUILT_IN_INFL:
@@ -4235,7 +4415,9 @@ fold_builtin (exp)
return 0;
}
-static tree
+/* Conveniently construct a function call expression. */
+
+tree
build_function_call_expr (fn, arglist)
tree fn, arglist;
{
diff --git a/gcc/builtins.def b/gcc/builtins.def
index c214128efe7..44297457899 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -112,9 +112,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Like DEF_LIB_BUILTIN, except that the function is only a part of
the standard in C99 or above. */
#undef DEF_C99_BUILTIN
-#define DEF_C99_BUILTIN(ENUM, NAME, TYPE) \
+#define DEF_C99_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
- true, true, !flag_isoc99, ATTR_NOTHROW_LIST)
+ true, true, !flag_isoc99, ATTRS)
/* Like DEF_LIB_BUILTIN, except that the function is expanded in the
front-end. */
@@ -169,39 +169,115 @@ DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABSL,
"__builtin_fabsl",
BT_FN_LONG_DOUBLE_LONG_DOUBLE)
+DEF_LIB_BUILTIN(BUILT_IN_FLOOR,
+ "__builtin_floor",
+ BT_FN_DOUBLE_DOUBLE,
+ ATTR_CONST_NOTHROW_LIST)
+DEF_LIB_BUILTIN(BUILT_IN_FLOORF,
+ "__builtin_floorf",
+ BT_FN_FLOAT_FLOAT,
+ ATTR_CONST_NOTHROW_LIST)
+DEF_LIB_BUILTIN(BUILT_IN_FLOORL,
+ "__builtin_floorl",
+ BT_FN_LONG_DOUBLE_LONG_DOUBLE,
+ ATTR_CONST_NOTHROW_LIST)
+
+DEF_LIB_BUILTIN(BUILT_IN_CEIL,
+ "__builtin_ceil",
+ BT_FN_DOUBLE_DOUBLE,
+ ATTR_CONST_NOTHROW_LIST)
+DEF_LIB_BUILTIN(BUILT_IN_CEILF,
+ "__builtin_ceilf",
+ BT_FN_FLOAT_FLOAT,
+ ATTR_CONST_NOTHROW_LIST)
+DEF_LIB_BUILTIN(BUILT_IN_CEILL,
+ "__builtin_ceill",
+ BT_FN_LONG_DOUBLE_LONG_DOUBLE,
+ ATTR_CONST_NOTHROW_LIST)
+
+DEF_C99_BUILTIN(BUILT_IN_ROUND,
+ "__builtin_round",
+ BT_FN_DOUBLE_DOUBLE,
+ ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN(BUILT_IN_ROUNDF,
+ "__builtin_roundf",
+ BT_FN_FLOAT_FLOAT,
+ ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN(BUILT_IN_ROUNDL,
+ "__builtin_roundl",
+ BT_FN_LONG_DOUBLE_LONG_DOUBLE,
+ ATTR_CONST_NOTHROW_LIST)
+
+DEF_C99_BUILTIN(BUILT_IN_TRUNC,
+ "__builtin_trunc",
+ BT_FN_DOUBLE_DOUBLE,
+ ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN(BUILT_IN_TRUNCF,
+ "__builtin_truncf",
+ BT_FN_FLOAT_FLOAT,
+ ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN(BUILT_IN_TRUNCL,
+ "__builtin_truncl",
+ BT_FN_LONG_DOUBLE_LONG_DOUBLE,
+ ATTR_CONST_NOTHROW_LIST)
+
+DEF_C99_BUILTIN(BUILT_IN_NEARBYINT,
+ "__builtin_nearbyint",
+ BT_FN_DOUBLE_DOUBLE,
+ ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN(BUILT_IN_NEARBYINTF,
+ "__builtin_nearbyintf",
+ BT_FN_FLOAT_FLOAT,
+ ATTR_CONST_NOTHROW_LIST)
+DEF_C99_BUILTIN(BUILT_IN_NEARBYINTL,
+ "__builtin_nearbyintl",
+ BT_FN_LONG_DOUBLE_LONG_DOUBLE,
+ ATTR_CONST_NOTHROW_LIST)
+
DEF_C99_BUILTIN(BUILT_IN_LLABS,
"__builtin_llabs",
- BT_FN_LONGLONG_LONGLONG)
+ BT_FN_LONGLONG_LONGLONG,
+ ATTR_CONST_NOTHROW_LIST)
DEF_C99_BUILTIN(BUILT_IN_IMAXABS,
"__builtin_imaxabs",
- BT_FN_INTMAX_INTMAX)
+ BT_FN_INTMAX_INTMAX,
+ ATTR_CONST_NOTHROW_LIST)
DEF_C99_BUILTIN(BUILT_IN_CONJ,
"__builtin_conj",
- BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE)
+ BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE,
+ ATTR_CONST_NOTHROW_LIST)
DEF_C99_BUILTIN(BUILT_IN_CONJF,
"__builtin_conjf",
- BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT)
+ BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT,
+ ATTR_CONST_NOTHROW_LIST)
DEF_C99_BUILTIN(BUILT_IN_CONJL,
"__builtin_conjl",
- BT_FN_COMPLEX_LONG_DOUBLE_COMPLEX_LONG_DOUBLE)
+ BT_FN_COMPLEX_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
+ ATTR_CONST_NOTHROW_LIST)
DEF_C99_BUILTIN(BUILT_IN_CREAL,
"__builtin_creal",
- BT_FN_DOUBLE_COMPLEX_DOUBLE)
+ BT_FN_DOUBLE_COMPLEX_DOUBLE,
+ ATTR_CONST_NOTHROW_LIST)
DEF_C99_BUILTIN(BUILT_IN_CREALF,
"__builtin_crealf",
- BT_FN_FLOAT_COMPLEX_FLOAT)
+ BT_FN_FLOAT_COMPLEX_FLOAT,
+ ATTR_CONST_NOTHROW_LIST)
DEF_C99_BUILTIN(BUILT_IN_CREALL,
"__builtin_creall",
- BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE)
+ BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
+ ATTR_CONST_NOTHROW_LIST)
DEF_C99_BUILTIN(BUILT_IN_CIMAG,
"__builtin_cimag",
- BT_FN_DOUBLE_COMPLEX_DOUBLE)
+ BT_FN_DOUBLE_COMPLEX_DOUBLE,
+ ATTR_CONST_NOTHROW_LIST)
DEF_C99_BUILTIN(BUILT_IN_CIMAGF,
"__builtin_cimagf",
- BT_FN_FLOAT_COMPLEX_FLOAT)
+ BT_FN_FLOAT_COMPLEX_FLOAT,
+ ATTR_CONST_NOTHROW_LIST)
DEF_C99_BUILTIN(BUILT_IN_CIMAGL,
"__builtin_cimagl",
- BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE)
+ BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
+ ATTR_CONST_NOTHROW_LIST)
DEF_UNUSED_BUILTIN(BUILT_IN_DIV)
DEF_UNUSED_BUILTIN(BUILT_IN_LDIV)
diff --git a/gcc/c-aux-info.c b/gcc/c-aux-info.c
index 761fa848606..1297cc13377 100644
--- a/gcc/c-aux-info.c
+++ b/gcc/c-aux-info.c
@@ -24,6 +24,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "toplev.h"
#include "flags.h"
#include "tree.h"
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 76f79274861..79502d2fde8 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "real.h"
#include "flags.h"
@@ -5601,6 +5603,7 @@ handle_mode_attribute (node, name, args, flags, no_add_attrs)
int len = strlen (p);
enum machine_mode mode = VOIDmode;
tree typefm;
+ tree ptr_type;
if (len > 4 && p[0] == '_' && p[1] == '_'
&& p[len - 1] == '_' && p[len - 2] == '_')
@@ -5630,6 +5633,10 @@ handle_mode_attribute (node, name, args, flags, no_add_attrs)
else if (0 == (typefm = (*lang_hooks.types.type_for_mode)
(mode, TREE_UNSIGNED (type))))
error ("no data type for mode `%s'", p);
+ else if ((TREE_CODE (type) == POINTER_TYPE
+ || TREE_CODE (type) == REFERENCE_TYPE)
+ && !(*targetm.valid_pointer_mode) (mode))
+ error ("invalid pointer mode `%s'", p);
else
{
/* If this is a vector, make sure we either have hardware
@@ -5642,6 +5649,19 @@ handle_mode_attribute (node, name, args, flags, no_add_attrs)
return NULL_TREE;
}
+ if (TREE_CODE (type) == POINTER_TYPE)
+ {
+ ptr_type = build_pointer_type_for_mode (TREE_TYPE (type),
+ mode);
+ *node = ptr_type;
+ }
+ else if (TREE_CODE (type) == REFERENCE_TYPE)
+ {
+ ptr_type = build_reference_type_for_mode (TREE_TYPE (type),
+ mode);
+ *node = ptr_type;
+ }
+ else
*node = typefm;
/* No need to layout the type here. The caller should do this. */
}
diff --git a/gcc/c-convert.c b/gcc/c-convert.c
index 3634bbe44ea..3c0a21a822a 100644
--- a/gcc/c-convert.c
+++ b/gcc/c-convert.c
@@ -26,6 +26,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "flags.h"
#include "convert.h"
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index bb7d881ba80..8c86bc0d87a 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -28,6 +28,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "intl.h"
#include "tree.h"
#include "tree-inline.h"
diff --git a/gcc/c-dump.c b/gcc/c-dump.c
index 65407a507d5..541910b6b9d 100644
--- a/gcc/c-dump.c
+++ b/gcc/c-dump.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "c-tree.h"
#include "tree-dump.h"
diff --git a/gcc/c-errors.c b/gcc/c-errors.c
index 1bd52a8ed6f..d906357a99d 100644
--- a/gcc/c-errors.c
+++ b/gcc/c-errors.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "c-tree.h"
#include "tm_p.h"
diff --git a/gcc/c-format.c b/gcc/c-format.c
index 083e91278f8..7bd654f6b2b 100644
--- a/gcc/c-format.c
+++ b/gcc/c-format.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "flags.h"
#include "toplev.h"
diff --git a/gcc/c-lang.c b/gcc/c-lang.c
index 8614e2500e5..03488976470 100644
--- a/gcc/c-lang.c
+++ b/gcc/c-lang.c
@@ -22,6 +22,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "c-tree.h"
#include "c-common.h"
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index f2e9d5d1629..5507e6311d0 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "real.h"
#include "rtl.h"
@@ -233,7 +235,7 @@ cb_ident (pfile, line, str)
if (! flag_no_ident)
{
/* Convert escapes in the string. */
- tree value = lex_string (str->text, str->len, 0);
+ tree value ATTRIBUTE_UNUSED = lex_string (str->text, str->len, 0);
ASM_OUTPUT_IDENT (asm_out_file, TREE_STRING_POINTER (value));
}
#endif
diff --git a/gcc/c-objc-common.c b/gcc/c-objc-common.c
index 2d67b8f21c0..7d54d7ace4d 100644
--- a/gcc/c-objc-common.c
+++ b/gcc/c-objc-common.c
@@ -20,6 +20,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "insn-config.h"
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index b8e5fe52bb4..85ed5f325aa 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "c-common.h"
#include "c-pragma.h"
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index eab176a62f7..f2ffed0ba17 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -38,6 +38,8 @@ end ifc
%{
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "input.h"
#include "cpplib.h"
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c
index 4c43baa9b0d..a2e4c68d19a 100644
--- a/gcc/c-pragma.c
+++ b/gcc/c-pragma.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "function.h"
diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c
index 377018ed21e..685b46d434f 100644
--- a/gcc/c-pretty-print.c
+++ b/gcc/c-pretty-print.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "real.h"
#include "c-pretty-print.h"
#include "c-tree.h"
diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c
index 994b4625da5..0b8f5870134 100644
--- a/gcc/c-semantics.c
+++ b/gcc/c-semantics.c
@@ -23,6 +23,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "function.h"
#include "splay-tree.h"
@@ -455,6 +457,17 @@ genrtl_do_stmt (t)
expand_stmt (DO_BODY (t));
expand_end_null_loop ();
}
+ else if (integer_nonzerop (cond))
+ {
+ emit_nop ();
+ emit_line_note (input_filename, lineno);
+ expand_start_loop (1);
+
+ expand_stmt (DO_BODY (t));
+
+ emit_line_note (input_filename, lineno);
+ expand_end_loop ();
+ }
else
{
emit_nop ();
@@ -519,7 +532,10 @@ genrtl_for_stmt (t)
/* Expand the initialization. */
emit_nop ();
emit_line_note (input_filename, lineno);
- expand_start_loop_continue_elsewhere (1);
+ if (FOR_EXPR (t))
+ expand_start_loop_continue_elsewhere (1);
+ else
+ expand_start_loop (1);
genrtl_do_pushlevel ();
cond = expand_cond (FOR_COND (t));
@@ -541,9 +557,11 @@ genrtl_for_stmt (t)
input_filename = saved_filename;
lineno = saved_lineno;
emit_line_note (input_filename, lineno);
- expand_loop_continue_here ();
if (FOR_EXPR (t))
- genrtl_expr_stmt (FOR_EXPR (t));
+ {
+ expand_loop_continue_here ();
+ genrtl_expr_stmt (FOR_EXPR (t));
+ }
expand_end_loop ();
}
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index c63344d6682..308d0502006 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -31,6 +31,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "c-tree.h"
@@ -1470,7 +1472,7 @@ build_function_call (function, params)
{
tree fntype, fundecl = 0;
tree coerced_params;
- tree name = NULL_TREE, assembler_name = NULL_TREE, result;
+ tree name = NULL_TREE, result;
/* Strip NON_LVALUE_EXPRs, etc., since we aren't using as an lvalue. */
STRIP_TYPE_NOPS (function);
@@ -1479,7 +1481,6 @@ build_function_call (function, params)
if (TREE_CODE (function) == FUNCTION_DECL)
{
name = DECL_NAME (function);
- assembler_name = DECL_ASSEMBLER_NAME (function);
/* Differs from default_conversion by not setting TREE_ADDRESSABLE
(because calling an inline function does not mean the function
@@ -3649,20 +3650,10 @@ build_c_cast (type, expr)
if (field)
{
- const char *name;
tree t;
if (pedantic)
pedwarn ("ISO C forbids casts to union type");
- if (TYPE_NAME (type) != 0)
- {
- if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
- name = IDENTIFIER_POINTER (TYPE_NAME (type));
- else
- name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
- }
- else
- name = "";
t = digest_init (type, build (CONSTRUCTOR, type, NULL_TREE,
build_tree_list (field, value)), 0);
TREE_CONSTANT (t) = TREE_CONSTANT (value);
diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index b7e3ceac7b5..53f3aa54a5c 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "insn-config.h"
#include "flags.h"
diff --git a/gcc/calls.c b/gcc/calls.c
index 41725b57769..4d6cdd78aeb 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
@@ -36,10 +38,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "langhooks.h"
#include "target.h"
-#if !defined FUNCTION_OK_FOR_SIBCALL
-#define FUNCTION_OK_FOR_SIBCALL(DECL) 1
-#endif
-
/* Decide whether a function's arguments should be processed
from first to last or from last to first.
@@ -154,35 +152,6 @@ int stack_arg_under_construction;
static int calls_function PARAMS ((tree, int));
static int calls_function_1 PARAMS ((tree, int));
-/* Nonzero if this is a call to a `const' function. */
-#define ECF_CONST 1
-/* Nonzero if this is a call to a `volatile' function. */
-#define ECF_NORETURN 2
-/* Nonzero if this is a call to malloc or a related function. */
-#define ECF_MALLOC 4
-/* Nonzero if it is plausible that this is a call to alloca. */
-#define ECF_MAY_BE_ALLOCA 8
-/* Nonzero if this is a call to a function that won't throw an exception. */
-#define ECF_NOTHROW 16
-/* Nonzero if this is a call to setjmp or a related function. */
-#define ECF_RETURNS_TWICE 32
-/* Nonzero if this is a call to `longjmp'. */
-#define ECF_LONGJMP 64
-/* Nonzero if this is a syscall that makes a new process in the image of
- the current one. */
-#define ECF_FORK_OR_EXEC 128
-#define ECF_SIBCALL 256
-/* Nonzero if this is a call to "pure" function (like const function,
- but may read memory. */
-#define ECF_PURE 512
-/* Nonzero if this is a call to a function that returns with the stack
- pointer depressed. */
-#define ECF_SP_DEPRESSED 1024
-/* Nonzero if this call is known to always return. */
-#define ECF_ALWAYS_RETURN 2048
-/* Create libcall block around the call. */
-#define ECF_LIBCALL_BLOCK 4096
-
static void emit_call_1 PARAMS ((rtx, tree, tree, HOST_WIDE_INT,
HOST_WIDE_INT, HOST_WIDE_INT, rtx,
rtx, int, rtx, int,
@@ -219,7 +188,6 @@ static rtx emit_library_call_value_1 PARAMS ((int, rtx, rtx,
enum machine_mode,
int, va_list));
static int special_function_p PARAMS ((tree, int));
-static int flags_from_decl_or_type PARAMS ((tree));
static rtx try_to_integrate PARAMS ((tree, tree, rtx,
int, tree, rtx));
static int check_sibcall_argument_overlap_1 PARAMS ((rtx));
@@ -818,7 +786,7 @@ alloca_call_p (exp)
/* Detect flags (function attributes) from the function decl or type node. */
-static int
+int
flags_from_decl_or_type (exp)
tree exp;
{
@@ -1717,10 +1685,8 @@ rtx_for_function_call (fndecl, exp)
else
/* Generate an rtx (probably a pseudo-register) for the address. */
{
- rtx funaddr;
push_temp_slots ();
- funaddr = funexp
- = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, 0);
+ funexp = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, 0);
pop_temp_slots (); /* FUNEXP can't be BLKmode. */
emit_queue ();
}
@@ -2281,7 +2247,10 @@ expand_call (exp, target, ignore)
{
struct_value_size = int_size_in_bytes (TREE_TYPE (exp));
- if (target && GET_CODE (target) == MEM)
+ if (CALL_EXPR_HAS_RETURN_SLOT_ADDR (exp))
+ /* The structure value address arg is already in actparms. */
+ structure_value_addr_parm = 1;
+ else if (target && GET_CODE (target) == MEM)
structure_value_addr = XEXP (target, 0);
else
{
@@ -2467,16 +2436,13 @@ expand_call (exp, target, ignore)
It does not seem worth the effort since few optimizable
sibling calls will return a structure. */
|| structure_value_addr != NULL_RTX
- /* If the register holding the address is a callee saved
- register, then we lose. We have no way to prevent that,
- so we only allow calls to named functions. */
- /* ??? This could be done by having the insn constraints
- use a register class that is all call-clobbered. Any
- reload insns generated to fix things up would appear
- before the sibcall_epilogue. */
- || fndecl == NULL_TREE
+ /* Check whether the target is able to optimize the call
+ into a sibcall. */
+ || !(*targetm.function_ok_for_sibcall) (fndecl, exp)
+ /* Functions that do not return exactly once may not be sibcall
+ optimized. */
|| (flags & (ECF_RETURNS_TWICE | ECF_LONGJMP | ECF_NORETURN))
- || !FUNCTION_OK_FOR_SIBCALL (fndecl)
+ || TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (exp, 0))))
/* If this function requires more stack slots than the current
function, we cannot change it into a sibling call. */
|| args_size.constant > current_function_args_size
@@ -2608,7 +2574,7 @@ expand_call (exp, target, ignore)
is subject to race conditions, just as with multithreaded
programs. */
- emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__bb_fork_func"),
+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__gcov_flush"),
LCT_ALWAYS_RETURN,
VOIDmode, 0);
}
diff --git a/gcc/cfg.c b/gcc/cfg.c
index 9dc69d88348..36ea2e5276a 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -43,6 +43,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "hard-reg-set.h"
diff --git a/gcc/cfganal.c b/gcc/cfganal.c
index 7aeef93accd..170ba447315 100644
--- a/gcc/cfganal.c
+++ b/gcc/cfganal.c
@@ -22,6 +22,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* This file contains various simple utilities to analyze the CFG. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "hard-reg-set.h"
#include "basic-block.h"
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c
index 9ac758b2809..43acb9076ec 100644
--- a/gcc/cfgbuild.c
+++ b/gcc/cfgbuild.c
@@ -34,6 +34,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "hard-reg-set.h"
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 67ddfa90b89..ad507a1cd59 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -33,6 +33,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "hard-reg-set.h"
#include "basic-block.h"
diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c
index 3214e808886..e50f2ff856d 100644
--- a/gcc/cfglayout.c
+++ b/gcc/cfglayout.c
@@ -20,6 +20,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "hard-reg-set.h"
@@ -740,7 +742,6 @@ duplicate_insn_chain (from, to)
be reordered later. */
for (insn = from; insn != NEXT_INSN (to); insn = NEXT_INSN (insn))
{
- rtx new;
switch (GET_CODE (insn))
{
case INSN:
@@ -752,7 +753,7 @@ duplicate_insn_chain (from, to)
if (GET_CODE (PATTERN (insn)) == ADDR_VEC
|| GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC)
break;
- new = emit_copy_of_insn_after (insn, get_last_insn ());
+ emit_copy_of_insn_after (insn, get_last_insn ());
break;
case CODE_LABEL:
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index 0a2829f5c18..da958c22324 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -20,6 +20,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "hard-reg-set.h"
#include "basic-block.h"
@@ -331,11 +333,9 @@ flow_loop_nodes_find (header, loop)
basic_block *stack;
int sp;
int num_nodes = 1;
- int findex, lindex;
header->loop_father = loop;
header->loop_depth = loop->depth;
- findex = lindex = header->index;
if (loop->latch->loop_father != loop)
{
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index c8ad0984e00..ef233315a33 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -44,6 +44,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "hard-reg-set.h"
@@ -1219,7 +1221,6 @@ split_edge (edge_in)
edge edge_in;
{
basic_block bb;
- edge edge_out;
rtx before;
/* Abnormal edges cannot be split. */
@@ -1285,7 +1286,7 @@ split_edge (edge_in)
edge_in->dest->global_live_at_start);
}
- edge_out = make_single_succ_edge (bb, edge_in->dest, EDGE_FALLTHRU);
+ make_single_succ_edge (bb, edge_in->dest, EDGE_FALLTHRU);
/* For non-fallthry edges, we must adjust the predecessor's
jump instruction to target our new block. */
@@ -1818,7 +1819,7 @@ verify_flow_info ()
if (e->flags & EDGE_FALLTHRU)
n_fallthru++;
- if ((e->flags & ~EDGE_DFS_BACK) == 0)
+ if ((e->flags & ~(EDGE_DFS_BACK | EDGE_CAN_FALLTHRU)) == 0)
n_branch++;
if (e->flags & EDGE_ABNORMAL_CALL)
diff --git a/gcc/collect2.c b/gcc/collect2.c
index c26838427d7..59bbb80ed24 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -28,6 +28,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include <signal.h>
#if ! defined( SIGCHLD ) && defined( SIGCLD )
# define SIGCHLD SIGCLD
@@ -300,7 +302,6 @@ static int is_in_list PARAMS ((const char *, struct id *));
#endif
static void write_aix_file PARAMS ((FILE *, struct id *));
static char *resolve_lib_name PARAMS ((const char *));
-static int ignore_library PARAMS ((const char *));
#endif
static char *extract_string PARAMS ((const char **));
@@ -2684,6 +2685,41 @@ scan_libraries (prog_name)
#endif
+#ifdef COLLECT_EXPORT_LIST
+/* Array of standard AIX libraries which should not
+ be scanned for ctors/dtors. */
+static const char *const aix_std_libs[] = {
+ "/unix",
+ "/lib/libc.a",
+ "/lib/libm.a",
+ "/lib/libc_r.a",
+ "/lib/libm_r.a",
+ "/usr/lib/libc.a",
+ "/usr/lib/libm.a",
+ "/usr/lib/libc_r.a",
+ "/usr/lib/libm_r.a",
+ "/usr/lib/threads/libc.a",
+ "/usr/ccs/lib/libc.a",
+ "/usr/ccs/lib/libm.a",
+ "/usr/ccs/lib/libc_r.a",
+ "/usr/ccs/lib/libm_r.a",
+ NULL
+};
+
+/* This function checks the filename and returns 1
+ if this name matches the location of a standard AIX library. */
+static int ignore_library PARAMS ((const char *));
+static int
+ignore_library (name)
+ const char *name;
+{
+ const char *const *p = &aix_std_libs[0];
+ while (*p++ != NULL)
+ if (! strcmp (name, *p)) return 1;
+ return 0;
+}
+#endif /* COLLECT_EXPORT_LIST */
+
extern char *ldgetname ();
/* COFF version to scan the name list of the loaded program for
@@ -2903,38 +2939,6 @@ if (debug) fprintf (stderr, "found: %s\n", lib_buf);
fatal ("library lib%s not found", name);
return (NULL);
}
-
-/* Array of standard AIX libraries which should not
- be scanned for ctors/dtors. */
-static const char *const aix_std_libs[] = {
- "/unix",
- "/lib/libc.a",
- "/lib/libm.a",
- "/lib/libc_r.a",
- "/lib/libm_r.a",
- "/usr/lib/libc.a",
- "/usr/lib/libm.a",
- "/usr/lib/libc_r.a",
- "/usr/lib/libm_r.a",
- "/usr/lib/threads/libc.a",
- "/usr/ccs/lib/libc.a",
- "/usr/ccs/lib/libm.a",
- "/usr/ccs/lib/libc_r.a",
- "/usr/ccs/lib/libm_r.a",
- NULL
-};
-
-/* This function checks the filename and returns 1
- if this name matches the location of a standard AIX library. */
-static int
-ignore_library (name)
- const char *name;
-{
- const char *const *p = &aix_std_libs[0];
- while (*p++ != NULL)
- if (! strcmp (name, *p)) return 1;
- return 0;
-}
#endif /* COLLECT_EXPORT_LIST */
diff --git a/gcc/combine.c b/gcc/combine.c
index 4d24807e486..d6a86756ee9 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -76,6 +76,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tm_p.h"
#include "flags.h"
@@ -167,11 +169,6 @@ static int last_call_cuid;
static rtx subst_insn;
-/* This is an insn that belongs before subst_insn, but is not currently
- on the insn chain. */
-
-static rtx subst_prev_insn;
-
/* This is the lowest CUID that `subst' is currently dealing with.
get_last_value will not return a value if the register was set at or
after this CUID. If not for this mechanism, we could get confused if
@@ -199,7 +196,6 @@ static basic_block this_basic_block;
After combine, we'll need to re-do global life analysis with
those blocks as starting points. */
static sbitmap refresh_blocks;
-static int need_refresh;
/* The next group of arrays allows the recording of the last value assigned
to (hard or pseudo) register n. We use this information to see if a
@@ -571,15 +567,10 @@ combine_instructions (f, nregs)
label_tick = 1;
- /* We need to initialize it here, because record_dead_and_set_regs may call
- get_last_value. */
- subst_prev_insn = NULL_RTX;
-
setup_incoming_promotions ();
refresh_blocks = sbitmap_alloc (last_basic_block);
sbitmap_zero (refresh_blocks);
- need_refresh = 0;
for (insn = f, i = 0; insn; insn = NEXT_INSN (insn))
{
@@ -1752,11 +1743,10 @@ try_combine (i3, i2, i1, new_direct_jump_p)
never appear in the insn stream so giving it the same INSN_UID
as I2 will not cause a problem. */
- subst_prev_insn = i1
- = gen_rtx_INSN (VOIDmode, INSN_UID (i2), NULL_RTX, i2,
- BLOCK_FOR_INSN (i2), INSN_SCOPE (i2),
- XVECEXP (PATTERN (i2), 0, 1), -1, NULL_RTX,
- NULL_RTX);
+ i1 = gen_rtx_INSN (VOIDmode, INSN_UID (i2), NULL_RTX, i2,
+ BLOCK_FOR_INSN (i2), INSN_SCOPE (i2),
+ XVECEXP (PATTERN (i2), 0, 1), -1, NULL_RTX,
+ NULL_RTX);
SUBST (PATTERN (i2), XVECEXP (PATTERN (i2), 0, 0));
SUBST (XEXP (SET_SRC (PATTERN (i2)), 0),
@@ -2860,10 +2850,6 @@ try_combine (i3, i2, i1, new_direct_jump_p)
combine_successes++;
undo_commit ();
- /* Clear this here, so that subsequent get_last_value calls are not
- affected. */
- subst_prev_insn = NULL_RTX;
-
if (added_links_insn
&& (newi2pat == 0 || INSN_CUID (added_links_insn) < INSN_CUID (i2))
&& INSN_CUID (added_links_insn) < INSN_CUID (i3))
@@ -2892,10 +2878,6 @@ undo_all ()
}
undobuf.undos = 0;
-
- /* Clear this here, so that subsequent get_last_value calls are not
- affected. */
- subst_prev_insn = NULL_RTX;
}
/* We've committed to accepting the changes we made. Move all
@@ -12700,10 +12682,7 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
if (REG_NOTE_KIND (note) == REG_DEAD && place == 0
&& REGNO_REG_SET_P (bb->global_live_at_start,
REGNO (XEXP (note, 0))))
- {
- SET_BIT (refresh_blocks, this_basic_block->index);
- need_refresh = 1;
- }
+ SET_BIT (refresh_blocks, this_basic_block->index);
}
/* If the register is set or already dead at PLACE, we needn't do
@@ -12720,10 +12699,7 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
the note is a noop, we'll need do a global live update
after we remove them in delete_noop_moves. */
if (noop_move_p (place))
- {
- SET_BIT (refresh_blocks, this_basic_block->index);
- need_refresh = 1;
- }
+ SET_BIT (refresh_blocks, this_basic_block->index);
if (dead_or_set_p (place, XEXP (note, 0))
|| reg_bitfield_target_p (XEXP (note, 0), PATTERN (place)))
@@ -12795,7 +12771,6 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
{
SET_BIT (refresh_blocks,
this_basic_block->index);
- need_refresh = 1;
break;
}
continue;
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 3e889ae2280..abf17fb8c48 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -150,6 +150,13 @@
#
# gas Set to yes or no depending on whether the target
# system normally uses GNU as.
+#
+# need_64bit_hwint Set to yes if HOST_WIDE_INT must be 64 bits wide
+# for this target. This is true iff
+# MAX_LONG_TYPE_SIZE is 64. (The code which
+# determines the underlying integral type for
+# HOST_WIDE_INT cannot see the definition of
+# MAX_LONG_TYPE_SIZE.)
# The following variables are used in each case-construct to build up the
# outgoing variables:
@@ -209,6 +216,7 @@ gas="$gas_flag"
gnu_ld="$gnu_ld_flag"
enable_threads=$enable_threads_flag
target_gtfiles=
+need_64bit_hwint=
# Obsolete configurations.
case $machine in
@@ -219,7 +227,6 @@ case $machine in
| mn10200-*-* \
| ns32k-*-openbsd* \
| romp-*-openbsd* \
- | vax-*-vms* \
)
if test "x$enable_obsolete" != xyes; then
echo "*** Configuration $machine is obsolete." >&2
@@ -238,6 +245,7 @@ cpu_type=`echo $machine | sed 's/-.*$//'`
case $machine in
alpha*-*-*)
cpu_type=alpha
+ need_64bit_hwint=yes
;;
strongarm*-*-*)
cpu_type=arm
@@ -255,9 +263,11 @@ i[34567]86-*-*)
x86_64-*-*)
cpu_type=i386
extra_headers="mmintrin.h xmmintrin.h"
+ need_64bit_hwint=yes
;;
ia64-*-*)
extra_headers=ia64intrin.h
+ need_64bit_hwint=yes
;;
hppa*-*-* | parisc*-*-*)
cpu_type=pa
@@ -271,17 +281,30 @@ m68k-*-*)
;;
mips*-*-*)
cpu_type=mips
+ need_64bit_hwint=yes
;;
powerpc*-*-*)
cpu_type=rs6000
extra_headers="ppc-asm.h altivec.h spe.h"
+ need_64bit_hwint=yes
+ ;;
+rs6000*-*-*)
+ need_64bit_hwint=yes
+ ;;
+sparc64*-*-*)
+ cpu_type=sparc
+ need_64bit_hwint=yes
;;
sparc*-*-*)
cpu_type=sparc
;;
+s390*-*-*)
+ need_64bit_hwint=yes
+ ;;
# Note the 'l'; we need to be able to match e.g. "shle" or "shl".
sh[123456789l]*-*-*)
cpu_type=sh
+ need_64bit_hwint=yes
;;
tic4x-*-*)
cpu_type=c4x
@@ -312,7 +335,7 @@ case $machine in
;;
esac
-# Common parts for GNU/Linux, GNU/Hurd, OpenBSD, NetBSD, and FreeBSD systems.
+# Common parts for widely ported systems.
case $machine in
*-*-linux*)
xm_defines=POSIX
@@ -437,6 +460,13 @@ case $machine in
esac
fbsd_tm_file="${fbsd_tm_file} freebsd-spec.h freebsd.h"
;;
+*-*-vxworks*)
+ tmake_file=t-vxworks
+ tm_file="${tm_file} elfos.h svr4.h vxworks.h"
+ thread_file='vxworks'
+ use_collect2=yes
+ xm_defines=POSIX
+ ;;
esac
case $machine in
@@ -472,7 +502,6 @@ alpha-*-interix)
target_cpu_default="MASK_GAS|MASK_IEEE_CONFORMANT"
xm_defines=POSIX
- xm_file="alpha/xm-alpha-interix.h"
tmake_file="alpha/t-alpha t-interix alpha/t-interix alpha/t-ieee"
if test x$enable_threads = xyes ; then
thread_file='posix'
@@ -556,21 +585,10 @@ alpha*-dec-osf[45]*)
;;
esac
;;
-alpha*-*-vxworks*)
- xm_defines=POSIX
- tm_file="${tm_file} dbx.h alpha/vxworks.h"
- tmake_file="alpha/t-alpha alpha/t-ieee"
- if [ x$gas != xyes ]
- then
- extra_passes="mips-tfile mips-tdump"
- fi
- use_collect2=yes
- thread_file='vxworks'
- ;;
alpha64-dec-*vms*)
xm_defines=POSIX
tm_file="${tm_file} alpha/vms.h alpha/vms64.h"
- xm_file="alpha/xm-vms.h alpha/xm-vms64.h"
+ xm_file="alpha/xm-vms.h"
tmake_file="alpha/t-alpha alpha/t-vms alpha/t-vms64 alpha/t-ieee"
xmake_file=alpha/x-vms
exeext=.exe
@@ -611,11 +629,6 @@ arm-*-coff* | armel-*-coff*)
tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h"
tmake_file=arm/t-arm-coff
;;
-arm-*-vxworks*)
- tm_file="arm/semi.h arm/aout.h arm/coff.h arm/vxarm.h arm/arm.h"
- tmake_file=arm/t-arm-coff
- thread_file='vxworks'
- ;;
arm-semi-aout | armel-semi-aout)
tm_file="arm/semi.h arm/aout.h arm/arm.h"
tmake_file=arm/t-semi
@@ -751,6 +764,7 @@ hppa*64*-*-linux* | parisc*64*-*-linux*)
pa/pa-linux.h pa/pa64-regs.h pa/pa-64.h pa/pa64-linux.h"
tmake_file=pa/t-linux64
gas=yes gnu_ld=yes
+ need_64bit_hwint=yes
;;
hppa*-*-linux* | parisc*-*-linux*)
target_cpu_default="MASK_PA_11"
@@ -891,6 +905,7 @@ hppa*64*-*-hpux11*)
pa/pa64-regs.h pa/long_double.h pa/pa-hpux.h \
pa/pa-hpux11.h pa/pa-64.h pa/pa64-hpux.h"
fi
+ need_64bit_hwint=yes
tmake_file="pa/t-pa64 pa/t-pa-hpux"
xmake_file="pa/x-ada"
target_cpu_default="(MASK_PA_11|MASK_PA_20|MASK_GAS)"
@@ -1052,10 +1067,6 @@ i[34567]86-sequent-sysv*) # would otherwise be caught by i?86-*-sysv*
echo "*** Configuration $machine not supported" 1>&2
exit 1
;;
-i[34567]86-wrs-vxworks*)
- tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h i386/vxi386.h"
- thread_file='vxworks'
- ;;
i[34567]86-*-aout*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h i386/i386-aout.h"
;;
@@ -1323,7 +1334,6 @@ i[34567]86-*-uwin*)
;;
i[34567]86-*-interix3*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/i386-interix.h i386/i386-interix3.h interix.h interix3.h"
- xm_file="i386/xm-i386-interix.h"
xm_defines=POSIX
tmake_file="t-interix i386/t-interix"
extra_objs=winnt.o
@@ -1337,7 +1347,6 @@ i[34567]86-*-interix3*)
;;
i[34567]86-*-interix*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/i386-interix.h interix.h"
- xm_file="i386/xm-i386-interix.h"
xm_defines=POSIX
tmake_file="t-interix i386/t-interix"
extra_objs=winnt.o
@@ -1348,30 +1357,6 @@ i[34567]86-*-interix*)
tm_file="${tm_file} dbxcoff.h"
fi
;;
-i960-wrs-vxworks5 | i960-wrs-vxworks5.0*)
- tm_file="${tm_file} i960/vx960.h"
- tmake_file=i960/t-vxworks960
- use_collect2=yes
- thread_file='vxworks'
- c_target_objs="i960-c.o"
- cxx_target_objs="i960-c.o"
- ;;
-i960-wrs-vxworks5* | i960-wrs-vxworks)
- tm_file="${tm_file} dbxcoff.h i960/i960-coff.h i960/vx960-coff.h"
- tmake_file=i960/t-vxworks960
- use_collect2=yes
- thread_file='vxworks'
- c_target_objs="i960-c.o"
- cxx_target_objs="i960-c.o"
- ;;
-i960-wrs-vxworks*)
- tm_file="${tm_file} i960/vx960.h"
- tmake_file=i960/t-vxworks960
- use_collect2=yes
- thread_file='vxworks'
- c_target_objs="i960-c.o"
- cxx_target_objs="i960-c.o"
- ;;
i960-*-coff*)
tm_file="${tm_file} dbxcoff.h i960/i960-coff.h libgloss.h"
tmake_file=i960/t-960bare
@@ -1425,6 +1410,9 @@ ia64*-*-linux*)
tmake_file="t-slibgcc-elf-ver t-linux ia64/t-ia64 ia64/t-glibc"
target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
+ if test x"$use_libunwind_exceptions" = xyes; then
+ tmake_file="$tmake_file t-libunwind"
+ fi
;;
ia64*-*-hpux*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h ia64/sysv4.h ia64/hpux.h ia64/hpux_longdouble.h"
@@ -1612,11 +1600,6 @@ m68k-sun-sunos*) # For SunOS 4 (the default).
fi
use_collect2=yes
;;
-m68k-wrs-vxworks*)
- tm_file=m68k/vxm68k.h
- tmake_file=m68k/t-vxworks68
- thread_file='vxworks'
- ;;
m68k-*-aout*)
tmake_file=m68k/t-m68kbare
tm_file="m68k/m68k-aout.h libgloss.h"
@@ -1758,14 +1741,6 @@ mips-sgi-irix6*) # SGI System V.4., IRIX 6
# thread_file='irix'
# fi
;;
-mips-wrs-vxworks)
- tm_file="${tm_file} mips/elf.h mips/vxworks.h"
- tmake_file=mips/t-ecoff
- gas=yes
- gnu_ld=yes
- extra_parts="crtbegin.o crtend.o"
- thread_file='vxworks'
- ;;
mips-sgi-irix5cross64) # Irix5 host, Irix 6 target, cross64
tm_file="mips/iris6.h mips/cross64.h"
xm_defines=POSIX
@@ -1825,7 +1800,7 @@ mips-sgi-*) # would otherwise be caught by mips-*-elf*
mips*-*-netbsd*) # NetBSD/mips, either endian.
target_cpu_default="MASK_GAS|MASK_ABICALLS"
tm_file="elfos.h ${tm_file} mips/netbsd.h"
- tmake_file="${tmake_file} mips/t-netbsd"
+ tmake_file="${tmake_file}"
;;
mips*-*-linux*) # Linux MIPS, either endian.
tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
@@ -1835,7 +1810,7 @@ mips*-*-linux*) # Linux MIPS, either endian.
tm_defines="MIPS_ISA_DEFAULT=32"
;;
esac
- tmake_file="t-slibgcc-elf-ver t-linux mips/t-linux"
+ tmake_file="t-slibgcc-elf-ver t-linux"
;;
mips*el-*-openbsd*) # mips little endian
target_cpu_default="MASK_GAS|MASK_ABICALLS"
@@ -1919,6 +1894,7 @@ mipstx39-*-elf* | mipstx39el-*-elf*)
tmake_file=mips/t-r3900
;;
mmix-knuth-mmixware)
+ need_64bit_hwint=yes
;;
mn10200-*-*)
tm_file="dbxelf.h elfos.h svr4.h ${tm_file}"
@@ -1991,10 +1967,11 @@ powerpc-*-darwin*)
# Darwin linker does collect2 functionality
use_collect2=no
extra_headers=altivec.h
+ # override ppc default
+ need_64bit_hwint=
;;
powerpc*-*-freebsd*)
tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} rs6000/sysv4.h rs6000/freebsd.h"
- xm_file=rs6000/xm-sysv4.h
out_file=rs6000/rs6000.c
tmake_file="rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
;;
@@ -2095,23 +2072,19 @@ powerpc-*-gnu*)
fi
;;
powerpc-wrs-vxworks*)
- xm_defines=POSIX
- tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/vxppc.h"
- tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
- thread_file='vxworks'
- ;;
+ # We want vxworks.h after rs6000/sysv4.h, which unfortunately
+ # means we have to redo the tm_file list from scratch.
+ tm_file="rs6000/rs6000.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h"
+ tm_file="${tm_file} vxworks.h rs6000/vxworks.h"
+ tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-vxworks"
+ extra_headers=ppc-asm.h
+ ;;
powerpc-wrs-windiss*)
xm_defines=POSIX
tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/windiss.h"
tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
thread_file=""
;;
-powerpcle-wrs-vxworks*)
- xm_defines=POSIX
- tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/vxppc.h"
- tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
- thread_file='vxworks'
- ;;
powerpcle-*-sysv*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h"
xm_defines=POSIX
@@ -2249,7 +2222,7 @@ sh-*-rtems*)
fi
;;
sh-*-linux* | sh[2346lbe]*-*-linux*)
- tmake_file="sh/t-sh sh/t-elf sh/t-linux"
+ tmake_file="sh/t-sh sh/t-elf t-slibgcc-elf-ver t-linux sh/t-linux"
case $machine in
sh*be-*-* | sh*eb-*-*) ;;
*)
@@ -2258,7 +2231,6 @@ sh-*-linux* | sh[2346lbe]*-*-linux*)
;;
esac
tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/linux.h"
- gas=yes gnu_ld=yes
case $machine in
sh64*)
tmake_file="${tmake_file} sh/t-sh64"
@@ -2315,17 +2287,6 @@ sparc-tti-*)
tm_file="${tm_file} sparc/pbd.h"
xm_defines=POSIX
;;
-sparc64-wrs-vxworks*)
- tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h sparc/sol2.h sparc/elf.h sparc/biarch64.h gofast.h sparc/vxsparc64.h"
- tmake_file="sparc/t-vxsparc64 sparc/t-crtfm"
- use_collect2=yes
- ;;
-sparc-wrs-vxworks* | sparclite-wrs-vxworks*)
- tm_file="${tm_file} aoutos.h sparc/aout.h gofast.h sparc/vxsparc.h"
- tmake_file=sparc/t-vxsparc
- use_collect2=yes
- thread_file='vxworks'
- ;;
sparc-*-aout*)
tmake_file=sparc/t-sparcbare
tm_file="sparc/sparc.h aoutos.h sparc/aout.h libgloss.h"
@@ -2348,7 +2309,6 @@ sparc-*-openbsd*)
;;
sparc64-*-openbsd*)
tm_file="sparc/openbsd1-64.h sparc/sparc.h elfos.h svr4.h sparc/sysv4.h sparc/sol2.h sparc/sp64-elf.h openbsd.h sparc/openbsd64.h"
- xm_file=sparc/xm-sp64.h
gas=yes gnu_ld=yes
with_cpu=ultrasparc
;;
@@ -2435,6 +2395,7 @@ sparc64-*-solaris2* | sparcv9-*-solaris2*)
thread_file='solaris'
fi
fi
+ need_64bit_hwint=yes
;;
sparc-hal-solaris2*)
xm_defines=POSIX
@@ -2475,6 +2436,7 @@ sparc-*-solaris2*)
tm_file="${tm_file} sparc/sol2-gas-bi.h"
fi
tmake_file="$tmake_file sparc/t-sol2-64"
+ need_64bit_hwint=yes
;;
esac
xm_defines=POSIX
@@ -2515,11 +2477,6 @@ sparc-*-sysv4*)
tmake_file=t-svr4
extra_parts="crtbegin.o crtend.o"
;;
-sparc-*-vxsim*)
- xm_defines=POSIX
- tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/vxsim.h"
- tmake_file=sparc/t-vxsparc
- ;;
sparclet-*-aout*)
tm_file="${tm_file} aoutos.h sparc/aout.h sparc/splet.h libgloss.h"
tmake_file=sparc/t-splet
@@ -2563,6 +2520,7 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd*)
x) with_cpu=ultrasparc ;;
*) echo "$with_cpu not supported for freebsd target"; exit 1 ;;
esac
+ need_64bit_hwint=yes
;;
sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux
tmake_file="t-slibgcc-elf-ver t-linux sparc/t-linux64 sparc/t-crtfm"
@@ -2666,8 +2624,8 @@ vax-*-ultrix*) # VAXen running ultrix
tm_file="${tm_file} vax/ultrix.h"
;;
vax-*-vms*) # VAXen running VMS
- xm_file=vax/xm-vms.h
- tm_file=vax/vms.h
+ echo "Configuration $machine no longer supported" 1>&2
+ exit 1
;;
vax-*-*) # VAX default entry
;;
@@ -2746,6 +2704,9 @@ i586-*-*)
;;
i686-*-* | i786-*-*)
case $target_alias in
+ k8-*)
+ target_cpu_default2=TARGET_CPU_DEFAULT_k8
+ ;;
athlon_xp-*|athlon_mp-*|athlon_4-*)
target_cpu_default2=TARGET_CPU_DEFAULT_athlon_sse
;;
@@ -2770,7 +2731,7 @@ x86_64-*-*)
# We should have hammer chip here, but it does not exist yet and
# thus it is not supported. Athlon_SSE is probably equivalent feature
# wise to hammer from our point of view except for 64bit mode.
- target_cpu_default2=TARGET_CPU_DEFAULT_athlon_sse
+ target_cpu_default2=TARGET_CPU_DEFAULT_k8
;;
alpha*-*-*)
case $machine in
diff --git a/gcc/config.in b/gcc/config.in
index d26ddfe23d8..0900cb4b07b 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -1,4 +1,4 @@
-/* config.in. Generated automatically from configure.in by autoheader. */
+/* config.in. Generated automatically from configure.in by autoheader 2.13. */
/* Define if using alloca.c. */
#undef C_ALLOCA
@@ -366,10 +366,16 @@
/* Define as the number of bits in a byte, if `limits.h' doesn't. */
#undef CHAR_BIT
+/* whether byteorder is bigendian */
+#undef WORDS_BIGENDIAN
+
/* Define if the host machine stores words of multi-word integers in
big-endian order. */
#undef HOST_WORDS_BIG_ENDIAN
+/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
+#undef BYTEORDER
+
/* Define to the floating point format of the host machine, if not IEEE. */
#undef HOST_FLOAT_FORMAT
@@ -492,6 +498,15 @@
/* Define if host mkdir takes a single argument. */
#undef MKDIR_TAKES_ONE_ARG
+/* Define 0/1 to force the choice for exception handling model. */
+#undef CONFIG_SJLJ_EXCEPTIONS
+
+/* Define if gcc should use -lunwind. */
+#undef USE_LIBUNWIND_EXCEPTIONS
+
+/* Define to 1 if HOST_WIDE_INT must be 64 bits wide (see hwint.h). */
+#undef NEED_64BIT_HOST_WIDE_INT
+
/* Define to the name of a file containing a list of extra machine modes
for this architecture. */
#undef EXTRA_MODES_FILE
@@ -596,12 +611,6 @@
/* Define if your MIPS libgloss linker scripts consistently include STARTUP directives. */
#undef HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES
-/* Define 0/1 to force the choice for exception handling model. */
-#undef CONFIG_SJLJ_EXCEPTIONS
-
-/* Define if gcc should use -lunwind. */
-#undef USE_LIBUNWIND_EXCEPTIONS
-
/* Bison unconditionally undefines `const' if neither `__STDC__' nor
__cplusplus are defined. That's a problem since we use `const' in
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index d6a9f6bc661..eeab8057204 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -23,6 +23,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "regs.h"
@@ -118,6 +120,8 @@ int alpha_this_literal_sequence_number;
int alpha_this_gpdisp_sequence_number;
/* Declarations of static functions. */
+static bool alpha_function_ok_for_sibcall
+ PARAMS ((tree, tree));
static int tls_symbolic_operand_1
PARAMS ((rtx, enum machine_mode, int, int));
static enum tls_model tls_symbolic_operand_type
@@ -297,6 +301,9 @@ static void unicosmk_unique_section PARAMS ((tree, int));
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN alpha_expand_builtin
+#undef TARGET_FUNCTION_OK_FOR_SIBCALL
+#define TARGET_FUNCTION_OK_FOR_SIBCALL alpha_function_ok_for_sibcall
+
#if TARGET_ABI_OSF
#undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK alpha_output_mi_thunk_osf
@@ -2274,6 +2281,19 @@ alpha_legitimize_address (x, scratch, mode)
}
}
+/* We do not allow indirect calls to be optimized into sibling calls, nor
+ can we allow a call to a function in a different compilation unit to
+ be optimized into a sibcall. */
+static bool
+alpha_function_ok_for_sibcall (decl, exp)
+ tree decl;
+ tree exp ATTRIBUTE_UNUSED;
+{
+ return (decl
+ && (! TREE_PUBLIC (decl)
+ || (TREE_ASM_WRITTEN (decl) && (*targetm.binds_local_p) (decl))));
+}
+
/* For TARGET_EXPLICIT_RELOCS, we don't obfuscate a SYMBOL_REF to a
small symbolic operand until after reload. At which point we need
to replace (mem (symbol_ref)) with (mem (lo_sum $29 symbol_ref))
@@ -9673,7 +9693,7 @@ unicosmk_output_addr_vec (file, vec)
int vlen = XVECLEN (body, 0);
int idx;
- ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (lab));
+ (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (lab));
for (idx = 0; idx < vlen; idx++)
{
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index 9e39a40395b..026c62a0bed 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -1164,14 +1164,6 @@ extern int alpha_memory_latency;
} \
}
-/* We do not allow indirect calls to be optimized into sibling calls, nor
- can we allow a call to a function in a different compilation unit to
- be optimized into a sibcall. */
-#define FUNCTION_OK_FOR_SIBCALL(DECL) \
- (DECL \
- && (! TREE_PUBLIC (DECL) \
- || (TREE_ASM_WRITTEN (DECL) && (*targetm.binds_local_p) (DECL))))
-
/* Try to output insns to set TARGET equal to the constant C if it can be
done in less than N insns. Do all computations in MODE. Returns the place
where the output has been placed if it can be done and the insns have been
@@ -1285,12 +1277,6 @@ do { \
/* Addressing modes, and classification of registers for them. */
-/* #define HAVE_POST_INCREMENT 0 */
-/* #define HAVE_POST_DECREMENT 0 */
-
-/* #define HAVE_PRE_DECREMENT 0 */
-/* #define HAVE_PRE_INCREMENT 0 */
-
/* Macros to check register numbers against specific register classes. */
/* These assume that REGNO is a hard or pseudo reg number.
@@ -1757,18 +1743,12 @@ do { \
#define USER_LABEL_PREFIX ""
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, "$%s%d:\n", PREFIX, NUM)
-
/* This is how to output a label for a jump table. Arguments are the same as
- for ASM_OUTPUT_INTERNAL_LABEL, except the insn for the jump table is
+ for (*targetm.asm_out.internal_label), except the insn for the jump table is
passed. */
#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \
-{ ASM_OUTPUT_ALIGN (FILE, 2); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); }
+{ ASM_OUTPUT_ALIGN (FILE, 2); (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); }
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
@@ -1877,14 +1857,6 @@ do { \
( fputs ("\t.lcomm ", (FILE)), \
assemble_name ((FILE), (NAME)), \
fprintf ((FILE), ",%d\n", (SIZE)))
-
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
/* Print operand X (an rtx) in assembler syntax to file FILE.
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index c878366b846..062e05e5c42 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -4727,20 +4727,19 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(use (reg:DI 26))
(clobber (reg:DI 27))]
"TARGET_ABI_OPEN_VMS"
- "*
{
switch (which_alternative)
{
case 0:
- return \"mov %2,$27\;jsr $26,0\;ldq $27,0($29)\";
+ return "mov %2,$27\;jsr $26,0\;ldq $27,0($29)";
case 1:
operands [2] = alpha_use_linkage (operands [0], cfun->decl, 1, 0);
operands [3] = alpha_use_linkage (operands [0], cfun->decl, 0, 0);
- return \"ldq $26,%3\;ldq $27,%2\;jsr $26,%0\;ldq $27,0($29)\";
+ return "ldq $26,%3\;ldq $27,%2\;jsr $26,%0\;ldq $27,0($29)";
default:
abort();
}
-}"
+}
[(set_attr "type" "jsr")
(set_attr "length" "12,16")])
@@ -6460,6 +6459,56 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
FAIL;
})
+(define_expand "movstrdi"
+ [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
+ (match_operand:BLK 1 "memory_operand" ""))
+ (use (match_operand:DI 2 "immediate_operand" ""))
+ (use (match_operand:DI 3 "immediate_operand" ""))
+ (use (match_dup 4))
+ (clobber (reg:DI 25))
+ (clobber (reg:DI 16))
+ (clobber (reg:DI 17))
+ (clobber (reg:DI 18))
+ (clobber (reg:DI 19))
+ (clobber (reg:DI 20))
+ (clobber (reg:DI 26))
+ (clobber (reg:DI 27))])]
+ "TARGET_ABI_OPEN_VMS"
+{
+ operands[4] = gen_rtx_SYMBOL_REF (Pmode, "OTS$MOVE");
+ alpha_need_linkage (XSTR (operands[4], 0), 0);
+})
+
+(define_insn "*movstrdi_1"
+ [(set (match_operand:BLK 0 "memory_operand" "=m,=m")
+ (match_operand:BLK 1 "memory_operand" "m,m"))
+ (use (match_operand:DI 2 "nonmemory_operand" "r,i"))
+ (use (match_operand:DI 3 "immediate_operand" ""))
+ (use (match_operand:DI 4 "call_operand" "i,i"))
+ (clobber (reg:DI 25))
+ (clobber (reg:DI 16))
+ (clobber (reg:DI 17))
+ (clobber (reg:DI 18))
+ (clobber (reg:DI 19))
+ (clobber (reg:DI 20))
+ (clobber (reg:DI 26))
+ (clobber (reg:DI 27))]
+ "TARGET_ABI_OPEN_VMS"
+{
+ operands [5] = alpha_use_linkage (operands [4], cfun->decl, 0, 1);
+ switch (which_alternative)
+ {
+ case 0:
+ return "lda $16,%0\;bis $31,%2,$17\;lda $18,%1\;ldq $26,%5\;lda $25,3($31)\;jsr $26,%4\;ldq $27,0($29)";
+ case 1:
+ return "lda $16,%0\;lda $17,%2($31)\;lda $18,%1\;ldq $26,%5\;lda $25,3($31)\;jsr $26,%4\;ldq $27,0($29)";
+ default:
+ abort();
+ }
+}
+ [(set_attr "type" "multi")
+ (set_attr "length" "28")])
+
(define_expand "clrstrqi"
[(parallel [(set (match_operand:BLK 0 "memory_operand" "")
(const_int 0))
@@ -6472,6 +6521,51 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
else
FAIL;
})
+
+(define_expand "clrstrdi"
+ [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
+ (const_int 0))
+ (use (match_operand:DI 1 "immediate_operand" ""))
+ (use (match_operand:DI 2 "immediate_operand" ""))
+ (use (match_dup 3))
+ (clobber (reg:DI 25))
+ (clobber (reg:DI 16))
+ (clobber (reg:DI 17))
+ (clobber (reg:DI 26))
+ (clobber (reg:DI 27))])]
+ "TARGET_ABI_OPEN_VMS"
+{
+ operands[3] = gen_rtx_SYMBOL_REF (Pmode, "OTS$ZERO");
+ alpha_need_linkage (XSTR (operands[3], 0), 0);
+})
+
+(define_insn "*clrstrdi_1"
+ [(set (match_operand:BLK 0 "memory_operand" "=m,=m")
+ (const_int 0))
+ (use (match_operand:DI 1 "nonmemory_operand" "r,i"))
+ (use (match_operand:DI 2 "immediate_operand" ""))
+ (use (match_operand:DI 3 "call_operand" "i,i"))
+ (clobber (reg:DI 25))
+ (clobber (reg:DI 16))
+ (clobber (reg:DI 17))
+ (clobber (reg:DI 26))
+ (clobber (reg:DI 27))]
+ "TARGET_ABI_OPEN_VMS"
+{
+ operands [4] = alpha_use_linkage (operands [3], cfun->decl, 0, 1);
+ switch (which_alternative)
+ {
+ case 0:
+ return "lda $16,%0\;bis $31,%1,$17\;ldq $26,%4\;lda $25,2($31)\;jsr $26,%3\;ldq $27,0($29)";
+ case 1:
+ return "lda $16,%0\;lda $17,%1($31)\;ldq $26,%4\;lda $25,2($31)\;jsr $26,%3\;ldq $27,0($29)";
+ default:
+ abort();
+ }
+}
+ [(set_attr "type" "multi")
+ (set_attr "length" "24")])
+
;; Subroutine of stack space allocation. Perform a stack probe.
(define_expand "probe_stack"
@@ -6571,7 +6665,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
""
{
operands[2] = gen_label_rtx ();
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (operands[2]));
return "stq $31,-8192(%1)\;subq %0,1,%0\;lda %1,-8192(%1)\;bne %0,%l2";
@@ -7918,20 +8012,19 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(use (reg:DI 26))
(clobber (reg:DI 27))]
"TARGET_ABI_OPEN_VMS"
- "*
{
switch (which_alternative)
{
case 0:
- return \"mov %3,$27\;jsr $26,0\;ldq $27,0($29)\";
+ return "mov %3,$27\;jsr $26,0\;ldq $27,0($29)";
case 1:
operands [3] = alpha_use_linkage (operands [1], cfun->decl, 1, 0);
operands [4] = alpha_use_linkage (operands [1], cfun->decl, 0, 0);
- return \"ldq $26,%4\;ldq $27,%3\;jsr $26,%1\;ldq $27,0($29)\";
+ return "ldq $26,%4\;ldq $27,%3\;jsr $26,%1\;ldq $27,0($29)";
default:
abort();
}
-}"
+}
[(set_attr "type" "jsr")
(set_attr "length" "12,16")])
diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h
index dbe92638664..afe96462d4e 100644
--- a/gcc/config/alpha/elf.h
+++ b/gcc/config/alpha/elf.h
@@ -103,7 +103,7 @@ do { \
#define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \
do { \
ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
- ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); \
} while (0)
/* The standard SVR4 assembler seems to require that certain builtin
diff --git a/gcc/config/alpha/unicosmk.h b/gcc/config/alpha/unicosmk.h
index 8f7b53db071..b8f9512f522 100644
--- a/gcc/config/alpha/unicosmk.h
+++ b/gcc/config/alpha/unicosmk.h
@@ -350,12 +350,12 @@ ssib_section () \
#undef ASM_OUTPUT_SOURCE_FILENAME
/* This is how to output a label for a jump table. Arguments are the same as
- for ASM_OUTPUT_INTERNAL_LABEL, except the insn for the jump table is
+ for (*targetm.asm_out.internal_label), except the insn for the jump table is
passed. */
#undef ASM_OUTPUT_CASE_LABEL
#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \
- ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM)
+ (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM)
/* CAM has some restrictions with respect to string literals. It won't
accept lines with more that 256 characters which means that we have
diff --git a/gcc/config/alpha/vms-cc.c b/gcc/config/alpha/vms-cc.c
index 26c3ae3b1ff..07b668f983d 100644
--- a/gcc/config/alpha/vms-cc.c
+++ b/gcc/config/alpha/vms-cc.c
@@ -25,6 +25,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#undef PATH_SEPARATOR
#undef PATH_SEPARATOR_STR
diff --git a/gcc/config/alpha/vms-ld.c b/gcc/config/alpha/vms-ld.c
index e5688d89d53..60e01d8ddd6 100644
--- a/gcc/config/alpha/vms-ld.c
+++ b/gcc/config/alpha/vms-ld.c
@@ -26,6 +26,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
typedef struct dsc {unsigned short len, mbz; char *adr; } Descr;
diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h
index 8df61564e72..57d8e697c46 100644
--- a/gcc/config/alpha/vms.h
+++ b/gcc/config/alpha/vms.h
@@ -306,7 +306,7 @@ extern void literals_section PARAMS ((void));
#undef ASM_OUTPUT_CASE_LABEL
#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \
-{ ASM_OUTPUT_ALIGN (FILE, 3); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); }
+{ ASM_OUTPUT_ALIGN (FILE, 3); (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); }
/* This says how to output assembler code to declare an
uninitialized external linkage data object. */
@@ -448,10 +448,7 @@ do { \
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE VMS_AND_DWARF2_DEBUG
-#undef ASM_FORMAT_PRIVATE_NAME
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12), \
- sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
+#define ASM_PN_FORMAT "%s___%lu"
/* ??? VMS uses different linkage. */
#undef TARGET_ASM_OUTPUT_MI_THUNK
diff --git a/gcc/config/alpha/vxworks.h b/gcc/config/alpha/vxworks.h
deleted file mode 100644
index a27c6452116..00000000000
--- a/gcc/config/alpha/vxworks.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Definitions of target machine for GNU compiler. Vxworks Alpha version.
- Copyright (C) 1998 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. */
-
-/* This file just exists to give specs for the Alpha running on VxWorks. */
-
-#undef CPP_SUBTARGET_SPEC
-#define CPP_SUBTARGET_SPEC "\
-%{mvxsim:-DCPU=SIMALPHADUNIX} \
-%{!mvxsim: %{!mcpu*|mcpu=21064:-DCPU=21064} %{mcpu=21164:-DCPU=21164}} \
-%{posix: -D_POSIX_SOURCE}"
-
-#define TARGET_OS_CPP_BUILTINS() \
- do { \
- builtin_define ("__vxworks"); \
- builtin_define ("__alpha_vxworks"); \
- builtin_define ("_LONGLONG"); \
- builtin_assert ("system=vxworks"); \
- builtin_assert ("system=embedded"); \
- } while (0)
-
-/* VxWorks does all the library stuff itself. */
-
-#undef LIB_SPEC
-#define LIB_SPEC ""
-
-/* VxWorks uses object files, not loadable images. Make linker just combine
- objects. Also show using 32 bit mode and set start of text to 0. */
-
-#undef LINK_SPEC
-#define LINK_SPEC "-r -taso -T 0"
-
-/* VxWorks provides the functionality of crt0.o and friends itself. */
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC ""
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC ""
diff --git a/gcc/config/alpha/xm-alpha-interix.h b/gcc/config/alpha/xm-alpha-interix.h
deleted file mode 100644
index dd71a1dfa09..00000000000
--- a/gcc/config/alpha/xm-alpha-interix.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Configuration for GNU compiler
- for an DEC/Compaq Alpha
- Copyright (C) 1999, 2001 Free Software Foundation, Inc.
- Donn Terry, Softway Systems, Inc.
- derived from code by Douglas B. Rupp (drupp@cs.washington.edu)
-
-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 HOST_BITS_PER_WIDE_INT 64
-#ifdef __GNUC__
-# define HOST_WIDE_INT long long
-#else
-# define HOST_WIDE_INT __int64
-#endif
-
-#define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_LONGLONG
-#ifdef __GNUC__
-# define HOST_WIDEST_INT long long
-#else
-# define HOST_WIDEST_INT __int64
-#endif
-#define HOST_WIDEST_INT_PRINT_DEC "%lld"
-#define HOST_WIDEST_INT_PRINT_UNSIGNED "%llu"
-#define HOST_WIDEST_INT_PRINT_HEX "0x%llx"
diff --git a/gcc/config/alpha/xm-vms.h b/gcc/config/alpha/xm-vms.h
index 7bfcebae81c..51806acd10d 100644
--- a/gcc/config/alpha/xm-vms.h
+++ b/gcc/config/alpha/xm-vms.h
@@ -19,9 +19,6 @@ 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 HOST_WIDE_INT long long
-#define HOST_BITS_PER_WIDE_INT 64
-
/* A couple of conditionals for execution machine are controlled here. */
#ifndef VMS
#define VMS
diff --git a/gcc/config/alpha/xm-vms64.h b/gcc/config/alpha/xm-vms64.h
deleted file mode 100644
index 26fd82923a4..00000000000
--- a/gcc/config/alpha/xm-vms64.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Configuration for GNU C-compiler for openVMS/Alpha.
- Copyright (C) 2001 Free Software Foundation, Inc.
- Contributed by Douglas Rupp (rupp@gnat.com).
-
-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. */
-
-#undef HOST_WIDE_INT
-
-/* Since DEC C long != Gnu C long */
-#define HOST_PTR_PRINTF "%llx"
-#define HOST_WIDE_INT_PRINT_DEC "%lld"
-#define HOST_WIDE_INT_PRINT_UNSIGNED "%llu"
-#define HOST_WIDE_INT_PRINT_HEX "0x%llx"
-#define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%llx%016llx"
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index ab7fe4280d2..c106b88e2cf 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -23,6 +23,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "regs.h"
@@ -93,6 +95,7 @@ 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_encode_section_info PARAMS ((tree, int));
+static void arc_internal_label PARAMS ((FILE *, const char *, unsigned long));
/* Initialize the GCC target structure. */
#undef TARGET_ASM_ALIGNED_HI_OP
@@ -110,6 +113,8 @@ static void arc_encode_section_info PARAMS ((tree, int));
#define TARGET_ATTRIBUTE_TABLE arc_attribute_table
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO arc_encode_section_info
+#undef TARGET_ASM_INTERNAL_LABEL
+#define TARGET_ASM_INTERNAL_LABEL arc_internal_label
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -1922,7 +1927,7 @@ record_cc_ref (insn)
0 -> 2 final_prescan_insn, if the `target' is an unconditional branch
1 -> 3 branch patterns, after having not output the conditional branch
2 -> 4 branch patterns, after having not output the conditional branch
- 3 -> 0 ASM_OUTPUT_INTERNAL_LABEL, if the `target' label is reached
+ 3 -> 0 (*targetm.asm_out.internal_label), if the `target' label is reached
(the target label has CODE_LABEL_NUMBER equal to
arc_ccfsm_target_label).
4 -> 0 final_prescan_insn, if `target' unconditional branch is reached
@@ -2218,7 +2223,7 @@ arc_final_prescan_insn (insn, opvec, noperands)
/* Record that we are currently outputting label NUM with prefix PREFIX.
It it's the label we're looking for, reset the ccfsm machinery.
- Called from ASM_OUTPUT_INTERNAL_LABEL. */
+ Called from (*targetm.asm_out.internal_label). */
void
arc_ccfsm_at_label (prefix, num)
@@ -2358,3 +2363,16 @@ arc_encode_section_info (decl, first)
if (TREE_CODE (decl) == FUNCTION_DECL)
SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
}
+
+/* This is how to output a definition of an internal numbered label where
+ 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_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 3c4904a7a92..7739fa4cdad 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -1202,7 +1202,7 @@ do { \
compiled for different cpus. */
/* We work around a dwarfout.c deficiency by watching for labels from it and
not adding the '_' prefix nor the cpu suffix. There is a comment in
- dwarfout.c that says it should be using ASM_OUTPUT_INTERNAL_LABEL. */
+ dwarfout.c that says it should be using (*targetm.asm_out.internal_label). */
extern const char *arc_mangle_cpu;
#define ASM_OUTPUT_LABELREF(FILE, NAME) \
do { \
@@ -1217,22 +1217,6 @@ do { \
} \
} while (0)
-/* This is how to output a definition of an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) \
-do { \
- arc_ccfsm_at_label (PREFIX, NUM); \
- fprintf (FILE, ".%s%d:\n", PREFIX, NUM); \
-} while (0)
-
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
/* Assembler pseudo-op to equate one value with another. */
/* ??? This is needed because dwarfout.c provides a default definition too
late for defaults.h (which contains the default definition of ASM_OUTPUT_DEF
diff --git a/gcc/config/arm/aof.h b/gcc/config/arm/aof.h
index 965337cf700..73b62b5bb58 100644
--- a/gcc/config/arm/aof.h
+++ b/gcc/config/arm/aof.h
@@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA. */
#define LINK_LIBGCC_SPECIAL 1
#define LINK_SPEC "%{aof} %{bin} %{aif} %{ihf} %{shl,*} %{reent*} %{split} \
- %{ov*,*} %{reloc*} -nodebug"
+ %{ov*} %{reloc*} -nodebug"
#define STARTFILE_SPEC "crtbegin.o%s"
@@ -267,10 +267,6 @@ do { \
#define ASM_GENERATE_INTERNAL_LABEL(STRING,PREFIX,NUM) \
sprintf ((STRING), "*|%s..%ld|", (PREFIX), (long)(NUM))
-#define ASM_FORMAT_PRIVATE_NAME(OUTVAR,NAME,NUMBER) \
- ((OUTVAR) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTVAR), "%s.%d", (NAME), (NUMBER)))
-
/* How initialization functions are handled */
#define CTORS_SECTION_ASM_OP "\tAREA\t|C$$gnu_ctorsvec|, DATA, READONLY"
diff --git a/gcc/config/arm/aout.h b/gcc/config/arm/aout.h
index 8f4a6056f98..a142ae11944 100644
--- a/gcc/config/arm/aout.h
+++ b/gcc/config/arm/aout.h
@@ -127,7 +127,7 @@ Boston, MA 02111-1307, USA. */
output_quoted_string (STREAM, NAME); \
fprintf (STREAM, ",%d,0,315,%s\n", N_SO, &ltext_label_name[1]); \
text_section (); \
- ASM_OUTPUT_INTERNAL_LABEL (STREAM, "Ltext", 0); \
+ (*targetm.asm_out.internal_label) (STREAM, "Ltext", 0); \
} \
while (0)
@@ -151,11 +151,6 @@ Boston, MA 02111-1307, USA. */
sprintf (STRING, "*%s%s%u", LOCAL_LABEL_PREFIX, PREFIX, (unsigned int)(NUM))
#endif
-/* Construct a private name. */
-#define ASM_FORMAT_PRIVATE_NAME(OUTVAR, NAME, NUMBER) \
- ((OUTVAR) = (char *) alloca (strlen (NAME) + 10), \
- sprintf (OUTVAR, "%s.%d", NAME, NUMBER))
-
/* Output an element of a dispatch table. */
#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
asm_fprintf (STREAM, "\t.word\t%LL%d\n", VALUE)
diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h
index cae9bea4ce8..b0173be1894 100644
--- a/gcc/config/arm/arm-protos.h
+++ b/gcc/config/arm/arm-protos.h
@@ -42,7 +42,6 @@ extern unsigned int arm_compute_initial_elimination_offset PARAMS ((unsigned in
#ifdef TREE_CODE
extern int arm_return_in_memory PARAMS ((tree));
extern void arm_encode_call_attribute PARAMS ((tree, int));
-extern int arm_function_ok_for_sibcall PARAMS ((tree));
#endif
#ifdef RTX_CODE
extern int arm_hard_regno_mode_ok PARAMS ((unsigned int,
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index a6203c3fbe3..c4326bac5c1 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "obstack.h"
@@ -117,6 +119,7 @@ static void arm_set_default_type_attributes PARAMS ((tree));
static int arm_adjust_cost PARAMS ((rtx, rtx, rtx, int));
static int count_insns_for_constant PARAMS ((HOST_WIDE_INT, int));
static int arm_get_strip_length PARAMS ((int));
+static bool arm_function_ok_for_sibcall PARAMS ((tree, tree));
#ifdef OBJECT_FORMAT_ELF
static void arm_elf_asm_named_section PARAMS ((const char *, unsigned int));
#endif
@@ -126,6 +129,7 @@ static void arm_encode_section_info PARAMS ((tree, int));
#ifdef AOF_ASSEMBLER
static void aof_globalize_label PARAMS ((FILE *, const char *));
#endif
+static void arm_internal_label PARAMS ((FILE *, const char *, unsigned long));
static void arm_output_mi_thunk PARAMS ((FILE *, tree,
HOST_WIDE_INT,
HOST_WIDE_INT, tree));
@@ -191,6 +195,12 @@ static void arm_output_mi_thunk PARAMS ((FILE *, tree,
#undef TARGET_STRIP_NAME_ENCODING
#define TARGET_STRIP_NAME_ENCODING arm_strip_name_encoding
+#undef TARGET_ASM_INTERNAL_LABEL
+#define TARGET_ASM_INTERNAL_LABEL arm_internal_label
+
+#undef TARGET_FUNCTION_OK_FOR_SIBCALL
+#define TARGET_FUNCTION_OK_FOR_SIBCALL arm_function_ok_for_sibcall
+
#undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK arm_output_mi_thunk
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
@@ -2308,16 +2318,17 @@ arm_is_longcall_p (sym_ref, call_cookie, call_symbol)
/* Return nonzero if it is ok to make a tail-call to DECL. */
-int
-arm_function_ok_for_sibcall (decl)
+static bool
+arm_function_ok_for_sibcall (decl, exp)
tree decl;
+ tree exp ATTRIBUTE_UNUSED;
{
int call_type = TARGET_LONG_CALLS ? CALL_LONG : CALL_NORMAL;
/* Never tailcall something for which we have no decl, or if we
are in Thumb mode. */
if (decl == NULL || TARGET_THUMB)
- return 0;
+ return false;
/* Get the calling method. */
if (lookup_attribute ("short_call", TYPE_ATTRIBUTES (TREE_TYPE (decl))))
@@ -2329,20 +2340,20 @@ arm_function_ok_for_sibcall (decl)
a branch instruction. However, if not compiling PIC, we know
we can reach the symbol if it is in this compilation unit. */
if (call_type == CALL_LONG && (flag_pic || !TREE_ASM_WRITTEN (decl)))
- return 0;
+ return false;
/* If we are interworking and the function is not declared static
then we can't tail-call it unless we know that it exists in this
compilation unit (since it might be a Thumb routine). */
if (TARGET_INTERWORK && TREE_PUBLIC (decl) && !TREE_ASM_WRITTEN (decl))
- return 0;
+ return false;
/* Never tailcall from an ISR routine - it needs a special exit sequence. */
if (IS_INTERRUPT (arm_current_func_type ()))
- return 0;
+ return false;
/* Everything else is ok. */
- return 1;
+ return true;
}
@@ -8853,7 +8864,7 @@ arm_assemble_integer (x, size, aligned_p)
0 -> 2 final_prescan_insn if the `target' is an unconditional branch
1 -> 3 ASM_OUTPUT_OPCODE after not having output the conditional branch
2 -> 4 ASM_OUTPUT_OPCODE after not having output the conditional branch
- 3 -> 0 ASM_OUTPUT_INTERNAL_LABEL if the `target' label is reached
+ 3 -> 0 (*targetm.asm_out.internal_label) if the `target' label is reached
(the target label has CODE_LABEL_NUMBER equal to arm_target_label).
4 -> 0 final_prescan_insn if the `target' unconditional branch is reached
(the target insn is arm_target_insn).
@@ -11353,6 +11364,21 @@ arm_encode_section_info (decl, first)
}
#endif /* !ARM_PE */
+static void
+arm_internal_label (stream, prefix, labelno)
+ FILE *stream;
+ const char *prefix;
+ unsigned long labelno;
+{
+ if (arm_ccfsm_state == 3 && (unsigned) arm_target_label == labelno
+ && !strcmp (prefix, "L"))
+ {
+ arm_ccfsm_state = 0;
+ arm_target_insn = NULL;
+ }
+ default_internal_label (stream, prefix, labelno);
+}
+
/* Output code to add DELTA to the first argument, and then jump
to FUNCTION. Used for C++ multiple inheritance. */
@@ -11390,4 +11416,3 @@ arm_output_mi_thunk (file, thunk, delta, vcall_offset, function)
fputs ("(PLT)", file);
fputc ('\n', file);
}
-
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index eda2d47feff..186664c54e4 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -1517,12 +1517,6 @@ typedef struct
arm_va_arg (valist, type)
-/* Tail calling. */
-
-/* A C expression that evaluates to true if it is ok to perform a sibling
- call to DECL. */
-#define FUNCTION_OK_FOR_SIBCALL(DECL) arm_function_ok_for_sibcall ((DECL))
-
/* Perform any actions needed for a function that is receiving a variable
number of arguments. CUM is as above. MODE and TYPE are the mode and type
of the current parameter. PRETEND_SIZE is a variable that should be set to
@@ -2486,25 +2480,6 @@ extern int making_const_table;
#undef ASM_APP_OFF
#define ASM_APP_OFF (TARGET_THUMB ? "\t.code\t16\n" : "")
-/* Output an internal label definition. */
-#ifndef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM) \
- do \
- { \
- char * s = (char *) alloca (40 + strlen (PREFIX)); \
- \
- if (arm_ccfsm_state == 3 && arm_target_label == (NUM) \
- && !strcmp (PREFIX, "L")) \
- { \
- arm_ccfsm_state = 0; \
- arm_target_insn = NULL; \
- } \
- ASM_GENERATE_INTERNAL_LABEL (s, (PREFIX), (NUM)); \
- ASM_OUTPUT_LABEL (STREAM, s); \
- } \
- while (0)
-#endif
-
/* Output a push or a pop instruction (only used when profiling). */
#define ASM_OUTPUT_REG_PUSH(STREAM, REGNO) \
if (TARGET_ARM) \
@@ -2529,7 +2504,7 @@ extern int making_const_table;
{ \
if (TARGET_THUMB) \
ASM_OUTPUT_ALIGN (FILE, 2); \
- ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); \
} \
while (0)
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 82fafa3f7fa..be955ce61b0 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -4206,7 +4206,7 @@
(use (label_ref (match_operand 1 "" "")))]
"TARGET_THUMB && flag_pic"
"*
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (operands[1]));
return \"add\\t%0, %|pc\";
"
@@ -4219,7 +4219,7 @@
(use (label_ref (match_operand 1 "" "")))]
"TARGET_ARM && flag_pic"
"*
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (operands[1]));
return \"add%?\\t%0, %|pc, %0\";
"
diff --git a/gcc/config/arm/elf.h b/gcc/config/arm/elf.h
index 0ad23f8f5d0..53a67d5c11e 100644
--- a/gcc/config/arm/elf.h
+++ b/gcc/config/arm/elf.h
@@ -128,26 +128,6 @@ Boston, MA 02111-1307, USA. */
} \
while (0)
#endif
-
-/* Output an internal label definition. */
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM) \
- do \
- { \
- char * s = (char *) alloca (40 + strlen (PREFIX)); \
- extern int arm_target_label, arm_ccfsm_state; \
- extern rtx arm_target_insn; \
- \
- if (arm_ccfsm_state == 3 && arm_target_label == (NUM) \
- && !strcmp (PREFIX, "L")) \
- { \
- arm_ccfsm_state = 0; \
- arm_target_insn = NULL; \
- } \
- ASM_GENERATE_INTERNAL_LABEL (s, (PREFIX), (NUM)); \
- ASM_OUTPUT_LABEL (STREAM, s); \
- } \
- while (0)
#undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION arm_elf_asm_named_section
diff --git a/gcc/config/arm/pe.c b/gcc/config/arm/pe.c
index ee3da8fd411..57c53f3b77c 100644
--- a/gcc/config/arm/pe.c
+++ b/gcc/config/arm/pe.c
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "output.h"
#include "flags.h"
diff --git a/gcc/config/arm/t-pe b/gcc/config/arm/t-pe
index f559bd20cff..ba4ea10e402 100644
--- a/gcc/config/arm/t-pe
+++ b/gcc/config/arm/t-pe
@@ -20,8 +20,8 @@ dp-bit.c: $(srcdir)/config/fp-bit.c
echo '#endif' >> dp-bit.c
cat $(srcdir)/config/fp-bit.c >> dp-bit.c
-pe.o: $(srcdir)/config/arm/pe.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) output.h \
- flags.h $(TREE_H) $(EXPR_H) toplev.h $(TM_P_H)
+pe.o: $(srcdir)/config/arm/pe.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(RTL_H) output.h flags.h $(TREE_H) expr.h toplev.h $(TM_P_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/arm/pe.c
MULTILIB_OPTIONS = mhard-float mthumb
diff --git a/gcc/config/arm/t-strongarm-pe b/gcc/config/arm/t-strongarm-pe
index 6a44132bd07..e6c65bfc69e 100644
--- a/gcc/config/arm/t-strongarm-pe
+++ b/gcc/config/arm/t-strongarm-pe
@@ -20,7 +20,8 @@ dp-bit.c: $(srcdir)/config/fp-bit.c
echo '#endif' >> dp-bit.c
cat $(srcdir)/config/fp-bit.c >> dp-bit.c
-pe.o: $(srcdir)/config/arm/pe.c
+pe.o: $(srcdir)/config/arm/pe.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(RTL_H) output.h flags.h $(TREE_H) expr.h toplev.h $(TM_P_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/arm/pe.c
MULTILIB_OPTIONS = mhard-float/msoft-float
diff --git a/gcc/config/arm/vxarm.h b/gcc/config/arm/vxarm.h
deleted file mode 100644
index 473362e4332..00000000000
--- a/gcc/config/arm/vxarm.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Definitions of target machine for GNU compiler,
- for ARM with targetting the VXWorks run time environment.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
-
- Contributed by: Mike Stump <mrs@wrs.com>
-
-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 SUBTARGET_CPU_DEFAULT TARGET_CPU_arm710
-
-#undef SUBTARGET_CPP_SPEC
-#define SUBTARGET_CPP_SPEC \
-"%{march=arm710:-DCPU=ARM710A} \
- %{march=arm7tdmi:-DCPU=ARM7TDMI} \
- %{march=arm810:-DCPU=ARM810} \
- %{march=strongarm110:-DCPU=ARMSA110} \
- %{!march=*: \
- %{mcpu=arm710:-DCPU=ARM710A} \
- %{mcpu=arm7tdmi:-DCPU=ARM7TDMI} \
- %{mcpu=arm810:-DCPU=ARM810} \
- %{mcpu=strongarm110:-DCPU=ARMSA110}} \
- %{!mcpu*:%{!march=*:-DCPU=ARM710A}} \
-"
-
-#define TARGET_OS_CPP_BUILTINS() \
- do { \
- builtin_define ("__vxworks"); \
- } while (0)
-
-/* VxWorks does all the library stuff itself. */
-#undef LIB_SPEC
-#define LIB_SPEC ""
-
-/* VxWorks uses object files, not loadable images. make linker just
- combine objects. */
-#undef LINK_SPEC
-#define LINK_SPEC "-r"
-
-/* VxWorks provides the functionality of crt0.o and friends itself. */
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC ""
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC ""
-
-#undef TARGET_VERSION
-#define TARGET_VERSION fputs (" (ARM/VxWorks)", stderr);
-
-#undef ASM_FILE_START
-#define ASM_FILE_START(STREAM) \
- do \
- { \
- fprintf (STREAM, "%s Generated by gcc %s for ARM/VxWorks\n", \
- ASM_COMMENT_START, version_string); \
- } \
- while (0)
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 5e4e42c5ace..fcfec615c91 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -21,6 +21,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index 4281d01a254..4dcef89b91e 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -1307,8 +1307,6 @@ extern int avr_reg_order[];
addressing. */
#define HAVE_PRE_DECREMENT 1
-/* #define HAVE_PRE_INCREMENT
- #define HAVE_POST_DECREMENT */
/* Similar for other kinds of addressing. */
#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
@@ -2103,32 +2101,13 @@ do { \
setting the `DECL_ONE_ONLY' flag is enough to mark a declaration to
be emitted as one-only. */
-#define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM) \
-fprintf(STREAM, ".%s%d:\n", PREFIX, NUM)
-/* A C statement to output to the stdio stream STREAM a label whose
- name is made from the string PREFIX and the number NUM.
-
- It is absolutely essential that these labels be distinct from the
- labels used for user-level functions and variables. Otherwise,
- certain programs will have name conflicts with internal labels.
-
- It is desirable to exclude internal labels from the symbol table
- of the object file. Most assemblers have a naming convention for
- labels that should be excluded; on many systems, the letter `L' at
- the beginning of a label has this effect. You should find out what
- convention your system uses, and follow it.
-
- The usual definition of this macro is as follows:
-
- fprintf (STREAM, "L%s%d:\n", PREFIX, NUM) */
-
#define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
sprintf (STRING, "*.%s%d", PREFIX, NUM)
/* A C statement to store into the string STRING a label whose name
is made from the string PREFIX and the number NUM.
This string, when output subsequently by `assemble_name', should
- produce the output that `ASM_OUTPUT_INTERNAL_LABEL' would produce
+ produce the output that `(*targetm.asm_out.internal_label)' would produce
with the same PREFIX and NUM.
If the string begins with `*', then `assemble_name' will output
@@ -2139,27 +2118,6 @@ sprintf (STRING, "*.%s%d", PREFIX, NUM)
`ASM_OUTPUT_LABELREF' is also part of your machine description, so
you should know what it does on your machine.) */
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
-/* A C expression to assign to OUTVAR (which is a variable of type
- `char *') a newly allocated string made from the string NAME and
- the number NUMBER, with some suitable punctuation added. Use
- `alloca' to get space for the string.
-
- The string will be used as an argument to `ASM_OUTPUT_LABELREF' to
- produce an assembler label for an internal static variable whose
- name is NAME. Therefore, the string must be such as to result in
- valid assembler code. The argument NUMBER is different each time
- this macro is executed; it prevents conflicts between
- similarly-named internal static variables in different scopes.
-
- Ideally this string should not be a valid C identifier, to prevent
- any conflict with the user's own symbols. Most assemblers allow
- periods or percent signs in assembler symbols; putting at least
- one of these between the name and the number will suffice. */
-
/* `ASM_OUTPUT_WEAK_ALIAS (STREAM, NAME, VALUE)'
A C statement to output to the stdio stream STREAM assembler code
which defines (equates) the weak symbol NAME to have the value
@@ -2304,18 +2262,18 @@ sprintf (STRING, "*.%s%d", PREFIX, NUM)
The definition should be a C statement to output to the stdio
stream STREAM an assembler pseudo-instruction to generate a
reference to a label. VALUE is the number of an internal label
- whose definition is output using `ASM_OUTPUT_INTERNAL_LABEL'. For
+ whose definition is output using `(*targetm.asm_out.internal_label)'. For
example,
fprintf (STREAM, "\t.word L%d\n", VALUE) */
#define ASM_OUTPUT_CASE_LABEL(STREAM, PREFIX, NUM, TABLE) \
- progmem_section (), ASM_OUTPUT_INTERNAL_LABEL (STREAM, PREFIX, NUM)
+ progmem_section (), (*targetm.asm_out.internal_label) (STREAM, PREFIX, NUM)
/* `ASM_OUTPUT_CASE_LABEL (STREAM, PREFIX, NUM, TABLE)'
Define this if the label before a jump-table needs to be output
specially. The first three arguments are the same as for
- `ASM_OUTPUT_INTERNAL_LABEL'; the fourth argument is the jump-table
+ `(*targetm.asm_out.internal_label)'; the fourth argument is the jump-table
which follows (a `jump_insn' containing an `addr_vec' or
`addr_diff_vec').
@@ -2323,7 +2281,7 @@ sprintf (STRING, "*.%s%d", PREFIX, NUM)
the table.
If this macro is not defined, these labels are output with
- `ASM_OUTPUT_INTERNAL_LABEL'. */
+ `(*targetm.asm_out.internal_label)'. */
/* `ASM_OUTPUT_CASE_END (STREAM, NUM, TABLE)'
Define this if something special must be output at the end of a
@@ -2530,14 +2488,6 @@ extern int avr_case_values_threshold;
pass to `cc1plus'. */
#define ASM_SPEC "%{mmcu=*:-mmcu=%*}"
-/* A C string constant that tells the GNU CC driver program options to
- pass to the assembler. It can also specify how to translate
- options you give to GNU CC into options for GNU CC to pass to the
- assembler. See the file `sun3.h' for an example of this.
-
- Do not define this macro if it does not need to do anything. */
-
-#define ASM_FINAL_SPEC ""
/* A C string constant that tells the GNU CC driver program how to
run any programs which cleanup after the normal assembler.
Normally, this is not needed. See the file `mips.h' for an
diff --git a/gcc/config/c4x/c4x-c.c b/gcc/config/c4x/c4x-c.c
index 36d78fb8505..5b958a2ba97 100644
--- a/gcc/config/c4x/c4x-c.c
+++ b/gcc/config/c4x/c4x-c.c
@@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "toplev.h"
#include "cpplib.h"
diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c
index 354ac76d1fa..8fe42862d95 100644
--- a/gcc/config/c4x/c4x.c
+++ b/gcc/config/c4x/c4x.c
@@ -25,6 +25,8 @@ Boston, MA 02111-1307, USA. */
/* Some output-actions in c4x.md need these. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "regs.h"
diff --git a/gcc/config/c4x/c4x.h b/gcc/config/c4x/c4x.h
index 94cca09b597..576aaff3826 100644
--- a/gcc/config/c4x/c4x.h
+++ b/gcc/config/c4x/c4x.h
@@ -1651,17 +1651,11 @@ fini_section () \
/* The TI assembler wants to have hex numbers this way. */
#undef HOST_WIDE_INT_PRINT_HEX
-#ifndef HOST_WIDE_INT_PRINT_HEX
-# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
-# define HOST_WIDE_INT_PRINT_HEX "0%xh"
-# else
-# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
-# define HOST_WIDE_INT_PRINT_HEX "0%lxh"
-# else
-# define HOST_WIDE_INT_PRINT_HEX "0%llxh"
-# endif
-# endif
-#endif /* ! HOST_WIDE_INT_PRINT_HEX */
+#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
+# define HOST_WIDE_INT_PRINT_HEX "0%lxh"
+#else
+# define HOST_WIDE_INT_PRINT_HEX "0%llxh"
+#endif
/* Overall Framework of an Assembler File. */
/* We need to have a data section we can identify so that we can set
@@ -1724,12 +1718,6 @@ c4x_file_end (FILE)
#define USER_LABEL_PREFIX "_"
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) \
- fprintf (FILE, "%s%d:\n", PREFIX, NUM)
-
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
@@ -1738,14 +1726,6 @@ c4x_file_end (FILE)
#define ASM_GENERATE_INTERNAL_LABEL(BUFFER, PREFIX, NUM) \
sprintf (BUFFER, "*%s%d", PREFIX, NUM)
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s$%d", (NAME), (LABELNO)))
-
/* A C statement to output to the stdio stream STREAM assembler code which
defines (equates) the symbol NAME to have the value VALUE. */
diff --git a/gcc/config/c4x/t-c4x b/gcc/config/c4x/t-c4x
index d1a83fb4231..0ac2c7f1782 100644
--- a/gcc/config/c4x/t-c4x
+++ b/gcc/config/c4x/t-c4x
@@ -7,9 +7,9 @@ LIB1ASMFUNCS = _divsf3 _divsi3 _udivsi3 _umodsi3 _modsi3 _mulsi3 \
TARGET_LIBGCC2_CFLAGS = -Dexit=unused_exit
-c4x-c.o: $(srcdir)/config/c4x/c4x-c.c $(CONFIG_H) $(SYSTEM_H) cpplib.h \
- $(TREE_H) c-pragma.h toplev.h $(TM_P_H)
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+c4x-c.o: $(srcdir)/config/c4x/c4x-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(TREE_H) toplev.h $(CPPLIB_H) c-pragma.h $(TM_P_H)
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/c4x/c4x-c.c
MULTILIB_OPTIONS = m30 msmall mmemparm
MULTILIB_DIRNAMES = c3x small mem
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 2eb864f065c..0aeccc01636 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index 4aa88466c80..bd044f3a51a 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -122,7 +122,7 @@ extern const char *cris_elinux_stacksize_str;
someone will fight for us. This year in the mountains.
Note that for -melinux and -mlinux, command-line -isystem options are
emitted both before and after the synthesized one. We can't remove all
- of them: a %{<isystem} will only remove the first one and %{<isystem*}
+ of them: a %<isystem will only remove the first one and %<isystem*
will not do TRT. Those extra occurrences are harmless anyway. */
#define CPP_SPEC \
"-$ -D__CRIS_ABI_version=2\
@@ -1580,28 +1580,11 @@ call_ ## FUNC (void) \
handle (to #undef or ignore it) in a.out. */
#define HAVE_GAS_HIDDEN 1
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) \
- do \
- { \
- asm_fprintf (FILE, "%L%s%d:\n", PREFIX, NUM); \
- } \
- while (0)
-
/* Remove any previous definition (elfos.h). */
#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
sprintf (LABEL, "*%s%s%ld", LOCAL_LABEL_PREFIX, PREFIX, (long) NUM)
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
- do \
- { \
- (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10); \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)); \
- } \
- while (0)
-
-
/* Node: Initialization */
/* (no definitions) */
diff --git a/gcc/config/d30v/d30v.c b/gcc/config/d30v/d30v.c
index 8169d8ebd4f..4f282a80bcf 100644
--- a/gcc/config/d30v/d30v.c
+++ b/gcc/config/d30v/d30v.c
@@ -21,6 +21,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "regs.h"
diff --git a/gcc/config/d30v/d30v.h b/gcc/config/d30v/d30v.h
index 095a1def4af..6fdbbd434d5 100644
--- a/gcc/config/d30v/d30v.h
+++ b/gcc/config/d30v/d30v.h
@@ -2207,9 +2207,7 @@ typedef struct machine_function GTY(())
#define HAVE_POST_INCREMENT 1
/* Similar for other kinds of addressing. */
-/* #define HAVE_PRE_INCREMENT 0 */
#define HAVE_POST_DECREMENT 1
-/* #define HAVE_PRE_DECREMENT 0 */
/* A C expression that is 1 if the RTX X is a constant which is a valid
address. On most machines, this can be defined as `CONSTANT_P (X)', but a
@@ -2819,7 +2817,7 @@ extern const char *d30v_branch_cost_string;
outputting the label definition at the proper place. Here is how to do
this:
- ASM_OUTPUT_INTERNAL_LABEL (FILE, "LC", LABELNO);
+ (*targetm.asm_out.internal_label) (FILE, "LC", LABELNO);
When you output a pool entry specially, you should end with a `goto' to the
label JUMPTO. This will prevent the same pool entry from being output a
@@ -3075,31 +3073,11 @@ extern const char *d30v_branch_cost_string;
is in most Berkeley Unix systems. This macro is used in `assemble_name'. */
/* #define ASM_OUTPUT_LABELREF(STREAM, NAME) */
-/* A C statement to output to the stdio stream STREAM a label whose name is
- made from the string PREFIX and the number NUM.
-
- It is absolutely essential that these labels be distinct from the labels
- used for user-level functions and variables. Otherwise, certain programs
- will have name conflicts with internal labels.
-
- It is desirable to exclude internal labels from the symbol table of the
- object file. Most assemblers have a naming convention for labels that
- should be excluded; on many systems, the letter `L' at the beginning of a
- label has this effect. You should find out what convention your system
- uses, and follow it.
-
- The usual definition of this macro is as follows:
-
- fprintf (STREAM, "L%s%d:\n", PREFIX, NUM)
-
- Defined in svr4.h. */
-/* #define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM) */
-
/* A C statement to store into the string STRING a label whose name is made
from the string PREFIX and the number NUM.
This string, when output subsequently by `assemble_name', should produce the
- output that `ASM_OUTPUT_INTERNAL_LABEL' would produce with the same PREFIX
+ output that `(*targetm.asm_out.internal_label)' would produce with the same PREFIX
and NUM.
If the string begins with `*', then `assemble_name' will output the rest of
@@ -3118,28 +3096,6 @@ do { \
} while (0)
*/
-/* A C expression to assign to OUTVAR (which is a variable of type `char *') a
- newly allocated string made from the string NAME and the number NUMBER, with
- some suitable punctuation added. Use `alloca' to get space for the string.
-
- The string will be used as an argument to `ASM_OUTPUT_LABELREF' to produce
- an assembler label for an internal static variable whose name is NAME.
- Therefore, the string must be such as to result in valid assembler code.
- The argument NUMBER is different each time this macro is executed; it
- prevents conflicts between similarly-named internal static variables in
- different scopes.
-
- Ideally this string should not be a valid C identifier, to prevent any
- conflict with the user's own symbols. Most assemblers allow periods or
- percent signs in assembler symbols; putting at least one of these between
- the name and the number will suffice. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTVAR, NAME, NUMBER) \
-do { \
- (OUTVAR) = (char *) alloca (strlen ((NAME)) + 12); \
- sprintf ((OUTVAR), "%s.%ld", (NAME), (long)(NUMBER)); \
-} while (0)
-
/* A C statement to output to the stdio stream STREAM assembler code which
defines (equates) the symbol NAME to have the value VALUE.
@@ -3495,7 +3451,7 @@ do { \
The definition should be a C statement to output to the stdio stream STREAM
an assembler pseudo-instruction to generate a difference between two labels.
VALUE and REL are the numbers of two internal labels. The definitions of
- these labels are output using `ASM_OUTPUT_INTERNAL_LABEL', and they must be
+ these labels are output using `(*targetm.asm_out.internal_label)', and they must be
printed in the same way here. For example,
fprintf (STREAM, "\t.word L%d-L%d\n", VALUE, REL) */
@@ -3509,7 +3465,7 @@ fprintf (STREAM, "\t.word .L%d-.L%d\n", VALUE, REL)
The definition should be a C statement to output to the stdio stream STREAM
an assembler pseudo-instruction to generate a reference to a label. VALUE
is the number of an internal label whose definition is output using
- `ASM_OUTPUT_INTERNAL_LABEL'. For example,
+ `(*targetm.asm_out.internal_label)'. For example,
fprintf (STREAM, "\t.word L%d\n", VALUE) */
@@ -3517,7 +3473,7 @@ fprintf (STREAM, "\t.word .L%d-.L%d\n", VALUE, REL)
fprintf (STREAM, "\t.word .L%d\n", VALUE)
/* Define this if the label before a jump-table needs to be output specially.
- The first three arguments are the same as for `ASM_OUTPUT_INTERNAL_LABEL';
+ The first three arguments are the same as for `(*targetm.asm_out.internal_label)';
the fourth argument is the jump-table which follows (a `jump_insn'
containing an `addr_vec' or `addr_diff_vec').
@@ -3525,7 +3481,7 @@ fprintf (STREAM, "\t.word .L%d\n", VALUE)
table.
If this macro is not defined, these labels are output with
- `ASM_OUTPUT_INTERNAL_LABEL'.
+ `(*targetm.asm_out.internal_label)'.
Defined in svr4.h. */
/* #define ASM_OUTPUT_CASE_LABEL(STREAM, PREFIX, NUM, TABLE) */
diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c
index c04c2b57607..805a82486a2 100644
--- a/gcc/config/darwin-c.c
+++ b/gcc/config/darwin-c.c
@@ -22,6 +22,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "cpplib.h"
#include "tree.h"
#include "c-pragma.h"
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 3722950f634..a7dfe59bec6 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -22,6 +22,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 7997a46e7a5..a3dcc166818 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -694,13 +694,6 @@ objc_section_init () \
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
sprintf (LABEL, "*%s%ld", PREFIX, (long)(NUM))
-/* This is how to output an internal numbered label where PREFIX is
- the class of label and NUM is the number within the class. */
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, "%s%d:\n", PREFIX, NUM)
-
/* Since we have a separate readonly data section, define this so that
jump tables end up in text rather than data. */
diff --git a/gcc/config/dbxcoff.h b/gcc/config/dbxcoff.h
index b955932797c..1d54ecf3604 100644
--- a/gcc/config/dbxcoff.h
+++ b/gcc/config/dbxcoff.h
@@ -70,7 +70,7 @@ Boston, MA 02111-1307, USA. */
assemble_name (FILE, \
XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
putc ('\n', FILE); \
- ASM_OUTPUT_INTERNAL_LABEL (FILE, "LM", sym_lineno); \
+ (*targetm.asm_out.internal_label) (FILE, "LM", sym_lineno); \
sym_lineno++; \
} }
diff --git a/gcc/config/dbxelf.h b/gcc/config/dbxelf.h
index 9f8f56a1b01..dbc8f347eb3 100644
--- a/gcc/config/dbxelf.h
+++ b/gcc/config/dbxelf.h
@@ -69,7 +69,7 @@ do \
assemble_name (FILE, \
XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
putc ('\n', FILE); \
- ASM_OUTPUT_INTERNAL_LABEL (FILE, "LM", sym_lineno); \
+ (*targetm.asm_out.internal_label) (FILE, "LM", sym_lineno); \
sym_lineno += 1; \
} \
while (0)
diff --git a/gcc/config/dsp16xx/dsp16xx-protos.h b/gcc/config/dsp16xx/dsp16xx-protos.h
index a2f68afbc3e..c2a2584682d 100644
--- a/gcc/config/dsp16xx/dsp16xx-protos.h
+++ b/gcc/config/dsp16xx/dsp16xx-protos.h
@@ -81,7 +81,7 @@ extern void asm_output_float PARAMS ((FILE *, double));
extern void dsp16xx_file_start PARAMS ((void));
extern void coff_dsp16xx_file_start PARAMS ((FILE *));
extern void luxworks_dsp16xx_file_start PARAMS ((FILE *));
-extern struct rtx_def *(*dsp16xx_compare_gen) PARAMS (());
+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));
diff --git a/gcc/config/dsp16xx/dsp16xx.c b/gcc/config/dsp16xx/dsp16xx.c
index b031aa2bdcb..3b9f752914a 100644
--- a/gcc/config/dsp16xx/dsp16xx.c
+++ b/gcc/config/dsp16xx/dsp16xx.c
@@ -22,6 +22,8 @@ Boston, MA 02111-1307, USA. */
/* Some output-actions in dsp1600.md need these. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -58,7 +60,7 @@ const char *save_chip_name;
rtx dsp16xx_compare_op0;
rtx dsp16xx_compare_op1;
-rtx (*dsp16xx_compare_gen) PARAMS (());
+bool dsp16xx_compare_gen;
static const char *fp;
static const char *sp;
diff --git a/gcc/config/dsp16xx/dsp16xx.h b/gcc/config/dsp16xx/dsp16xx.h
index c530a02debc..fbbf50efec3 100644
--- a/gcc/config/dsp16xx/dsp16xx.h
+++ b/gcc/config/dsp16xx/dsp16xx.h
@@ -1288,9 +1288,6 @@ extern struct dsp16xx_frame_info current_frame_info;
#define HAVE_POST_INCREMENT 1
#define HAVE_POST_DECREMENT 1
-/* #define HAVE_PRE_DECREMENT 0 */
-/* #define HAVE_PRE_INCREMENT 0 */
-
/* Recognize any constant value that is a valid address. */
#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
@@ -1642,22 +1639,7 @@ extern struct dsp16xx_frame_info current_frame_info;
} \
while (0)
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable or function
- named NAME. LABELNO is an integer which is different for
- each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
- do { \
- int len = strlen (NAME); \
- char *temp = (char *) alloca (len + 3); \
- temp[0] = 'L'; \
- strcpy (&temp[1], (NAME)); \
- temp[len + 1] = '_'; \
- temp[len + 2] = 0; \
- (OUTPUT) = (char *) alloca (strlen (NAME) + 11); \
- ASM_GENERATE_INTERNAL_LABEL (OUTPUT, temp, LABELNO); \
- } while (0)
+#define ASM_PN_FORMAT "*L%s_%lu"
/* OUTPUT OF UNINITIALIZED VARIABLES */
@@ -1702,11 +1684,6 @@ extern struct dsp16xx_frame_info current_frame_info;
#define USER_LABEL_PREFIX "_"
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, "%s%d:\n", PREFIX, NUM)
-
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
diff --git a/gcc/config/dsp16xx/dsp16xx.md b/gcc/config/dsp16xx/dsp16xx.md
index 89c09a19349..fdb71de10a9 100644
--- a/gcc/config/dsp16xx/dsp16xx.md
+++ b/gcc/config/dsp16xx/dsp16xx.md
@@ -70,7 +70,7 @@
""
"
{
- dsp16xx_compare_gen = gen_tst_reg;
+ dsp16xx_compare_gen = false;
dsp16xx_compare_op0 = operands[0];
dsp16xx_compare_op1 = const0_rtx;
DONE;
@@ -89,7 +89,7 @@
""
"
{
- dsp16xx_compare_gen = gen_tst_reg;
+ dsp16xx_compare_gen = false;
dsp16xx_compare_op0 = operands[0];
dsp16xx_compare_op1 = const0_rtx;
DONE;
@@ -181,7 +181,7 @@
if (GET_CODE (operands[1]) == CONST_INT)
operands[1] = force_reg (HImode, operands[1]);
- dsp16xx_compare_gen = gen_compare_reg;
+ dsp16xx_compare_gen = true;
dsp16xx_compare_op0 = operands[0];
dsp16xx_compare_op1 = operands[1];
DONE;
@@ -266,7 +266,7 @@
{
if (operands[0]) /* Avoid unused code warning */
{
- dsp16xx_compare_gen = gen_compare_reg;
+ dsp16xx_compare_gen = true;
dsp16xx_compare_op0 = operands[0];
dsp16xx_compare_op1 = operands[1];
DONE;
@@ -433,7 +433,7 @@
if (!dsp16xx_cmphf3_libcall)
dsp16xx_cmphf3_libcall = gen_rtx_SYMBOL_REF (Pmode, CMPHF3_LIBCALL);
- dsp16xx_compare_gen = gen_compare_reg;
+ dsp16xx_compare_gen = true;
dsp16xx_compare_op0 = operands[0];
dsp16xx_compare_op1 = operands[1];
emit_library_call (dsp16xx_cmphf3_libcall, 1, HImode, 2,
@@ -2397,10 +2397,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(EQ, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (EQ, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
(define_expand "sne"
@@ -2409,10 +2409,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(NE, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (NE, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
@@ -2422,10 +2422,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(GT, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (GT, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
@@ -2435,10 +2435,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(LT, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (LT, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
(define_expand "sge"
@@ -2447,10 +2447,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(GE, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (GE, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
@@ -2460,10 +2460,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(LE, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (LE, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
@@ -2473,10 +2473,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(GTU, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (GTU, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
@@ -2486,10 +2486,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(LTU, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (LTU, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
@@ -2499,10 +2499,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(GEU, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (GEU, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
@@ -2512,10 +2512,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(LEU, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (LEU, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
@@ -2539,10 +2539,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(EQ, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (EQ, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
(define_expand "bne"
@@ -2554,10 +2554,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(NE, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (NE, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
@@ -2570,10 +2570,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(GT, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (GT, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
@@ -2586,10 +2586,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(GE, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (GE, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
@@ -2602,10 +2602,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(LT, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (LT, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
@@ -2618,10 +2618,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(LE, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (LE, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
@@ -2634,10 +2634,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(GTU, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (GTU, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
@@ -2650,10 +2650,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(GEU, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (GEU, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
@@ -2666,10 +2666,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(LTU, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (LTU, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
@@ -2682,10 +2682,10 @@
""
"
{
- if (dsp16xx_compare_gen == gen_compare_reg)
- operands[1] = (*dsp16xx_compare_gen)(LEU, dsp16xx_compare_op0, dsp16xx_compare_op1);
+ if (dsp16xx_compare_gen)
+ operands[1] = gen_compare_reg (LEU, dsp16xx_compare_op0, dsp16xx_compare_op1);
else
- operands[1] = (*dsp16xx_compare_gen)(dsp16xx_compare_op0);
+ operands[1] = gen_tst_reg (dsp16xx_compare_op0);
}")
diff --git a/gcc/config/elfos.h b/gcc/config/elfos.h
index 25a44afe344..3254a0ce621 100644
--- a/gcc/config/elfos.h
+++ b/gcc/config/elfos.h
@@ -110,20 +110,6 @@ Boston, MA 02111-1307, USA. */
#define ASM_OUTPUT_SKIP(FILE, SIZE) \
fprintf (FILE, "%s%u\n", SKIP_ASM_OP, (SIZE))
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class.
-
- For most svr4 systems, the convention is that any symbol which begins
- with a period is not put into the linker symbol table by the assembler. */
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) \
- do \
- { \
- fprintf (FILE, ".%s%u:\n", PREFIX, (unsigned) (NUM)); \
- } \
- while (0)
-
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
@@ -161,7 +147,7 @@ Boston, MA 02111-1307, USA. */
do \
{ \
ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
- ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); \
} \
while (0)
diff --git a/gcc/config/fp-bit.c b/gcc/config/fp-bit.c
index 7ec20ecf9f2..495a5978ac0 100644
--- a/gcc/config/fp-bit.c
+++ b/gcc/config/fp-bit.c
@@ -44,6 +44,8 @@ Boston, MA 02111-1307, USA. */
to one copy, then compile both copies and add them to libgcc.a. */
#include "tconfig.h"
+#include "coretypes.h"
+#include "tm.h"
#include "fp-bit.h"
/* The following macros can be defined to change the behavior of this file:
diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c
index d01d6bd1610..0c143b34224 100644
--- a/gcc/config/fr30/fr30.c
+++ b/gcc/config/fr30/fr30.c
@@ -23,6 +23,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
diff --git a/gcc/config/fr30/fr30.h b/gcc/config/fr30/fr30.h
index 32ee2d78549..57b24960679 100644
--- a/gcc/config/fr30/fr30.h
+++ b/gcc/config/fr30/fr30.h
@@ -1166,29 +1166,6 @@ do \
/* Globalizing directive for a label. */
#define GLOBAL_ASM_OP "\t.globl "
-/* A C expression to assign to OUTVAR (which is a variable of type `char *') a
- newly allocated string made from the string NAME and the number NUMBER, with
- some suitable punctuation added. Use `alloca' to get space for the string.
-
- The string will be used as an argument to `ASM_OUTPUT_LABELREF' to produce
- an assembler label for an internal static variable whose name is NAME.
- Therefore, the string must be such as to result in valid assembler code.
- The argument NUMBER is different each time this macro is executed; it
- prevents conflicts between similarly-named internal static variables in
- different scopes.
-
- Ideally this string should not be a valid C identifier, to prevent any
- conflict with the user's own symbols. Most assemblers allow periods or
- percent signs in assembler symbols; putting at least one of these between
- the name and the number will suffice. */
-#define ASM_FORMAT_PRIVATE_NAME(OUTVAR, NAME, NUMBER) \
- do \
- { \
- (OUTVAR) = (char *) alloca (strlen ((NAME)) + 12); \
- sprintf ((OUTVAR), "%s.%ld", (NAME), (long)(NUMBER)); \
- } \
- while (0)
-
/*}}}*/
/*{{{ Output of Assembler Instructions. */
@@ -1243,7 +1220,7 @@ do \
The definition should be a C statement to output to the stdio stream STREAM
an assembler pseudo-instruction to generate a difference between two labels.
VALUE and REL are the numbers of two internal labels. The definitions of
- these labels are output using `ASM_OUTPUT_INTERNAL_LABEL', and they must be
+ these labels are output using `(*targetm.asm_out.internal_label)', and they must be
printed in the same way here. For example,
fprintf (STREAM, "\t.word L%d-L%d\n", VALUE, REL) */
@@ -1256,7 +1233,7 @@ fprintf (STREAM, "\t.word .L%d-.L%d\n", VALUE, REL)
The definition should be a C statement to output to the stdio stream STREAM
an assembler pseudo-instruction to generate a reference to a label. VALUE
is the number of an internal label whose definition is output using
- `ASM_OUTPUT_INTERNAL_LABEL'. For example,
+ `(*targetm.asm_out.internal_label)'. For example,
fprintf (STREAM, "\t.word L%d\n", VALUE) */
#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index d09533a5f15..aa29d248c47 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -20,6 +20,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "regs.h"
diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h
index f9900b2f2bc..e7a481a728f 100644
--- a/gcc/config/frv/frv.h
+++ b/gcc/config/frv/frv.h
@@ -2888,7 +2888,7 @@ do { \
from the string PREFIX and the number NUM.
This string, when output subsequently by `assemble_name', should produce the
- output that `ASM_OUTPUT_INTERNAL_LABEL' would produce with the same PREFIX
+ output that `(*targetm.asm_out.internal_label)' would produce with the same PREFIX
and NUM.
If the string begins with `*', then `assemble_name' will output the rest of
@@ -2905,27 +2905,6 @@ do { \
sprintf (LABEL, "*.%s%ld", PREFIX, (long)NUM); \
} while (0)
-/* A C expression to assign to OUTVAR (which is a variable of type `char *') a
- newly allocated string made from the string NAME and the number NUMBER, with
- some suitable punctuation added. Use `alloca' to get space for the string.
-
- The string will be used as an argument to `ASM_OUTPUT_LABELREF' to produce
- an assembler label for an internal static variable whose name is NAME.
- Therefore, the string must be such as to result in valid assembler code.
- The argument NUMBER is different each time this macro is executed; it
- prevents conflicts between similarly-named internal static variables in
- different scopes.
-
- Ideally this string should not be a valid C identifier, to prevent any
- conflict with the user's own symbols. Most assemblers allow periods or
- percent signs in assembler symbols; putting at least one of these between
- the name and the number will suffice. */
-#define ASM_FORMAT_PRIVATE_NAME(OUTVAR, NAME, NUMBER) \
-do { \
- (OUTVAR) = (char *) alloca (strlen ((NAME)) + 12); \
- sprintf ((OUTVAR), "%s.%ld", (NAME), (long)(NUMBER)); \
-} while (0)
-
/* Macros Controlling Initialization Routines. */
@@ -3115,7 +3094,7 @@ do { \
The definition should be a C statement to output to the stdio stream STREAM
an assembler pseudo-instruction to generate a difference between two labels.
VALUE and REL are the numbers of two internal labels. The definitions of
- these labels are output using `ASM_OUTPUT_INTERNAL_LABEL', and they must be
+ these labels are output using `(*targetm.asm_out.internal_label)', and they must be
printed in the same way here. For example,
fprintf (STREAM, "\t.word L%d-L%d\n", VALUE, REL) */
@@ -3128,14 +3107,14 @@ fprintf (STREAM, "\t.word .L%d-.L%d\n", VALUE, REL)
The definition should be a C statement to output to the stdio stream STREAM
an assembler pseudo-instruction to generate a reference to a label. VALUE
is the number of an internal label whose definition is output using
- `ASM_OUTPUT_INTERNAL_LABEL'. For example,
+ `(*targetm.asm_out.internal_label)'. For example,
fprintf (STREAM, "\t.word L%d\n", VALUE) */
#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
fprintf (STREAM, "\t.word .L%d\n", VALUE)
/* Define this if the label before a jump-table needs to be output specially.
- The first three arguments are the same as for `ASM_OUTPUT_INTERNAL_LABEL';
+ The first three arguments are the same as for `(*targetm.asm_out.internal_label)';
the fourth argument is the jump-table which follows (a `jump_insn'
containing an `addr_vec' or `addr_diff_vec').
@@ -3143,7 +3122,7 @@ fprintf (STREAM, "\t.word .L%d\n", VALUE)
table.
If this macro is not defined, these labels are output with
- `ASM_OUTPUT_INTERNAL_LABEL'.
+ `(*targetm.asm_out.internal_label)'.
Defined in svr4.h. */
/* When generating embedded PIC or mips16 code we want to put the jump
@@ -3158,7 +3137,7 @@ fprintf (STREAM, "\t.word .L%d\n", VALUE)
do { \
if (flag_pic) \
function_section (current_function_decl); \
- ASM_OUTPUT_INTERNAL_LABEL (STREAM, PREFIX, NUM); \
+ (*targetm.asm_out.internal_label) (STREAM, PREFIX, NUM); \
} while (0)
/* Define this to determine whether case statement labels are relative to
@@ -3492,9 +3471,6 @@ frv_ifcvt_modify_multiple_tests (CE_INFO, BB, &TRUE_EXPR, &FALSE_EXPR)
scheduling. */
#define FIRST_CYCLE_MULTIPASS_SCHEDULING_LOOKAHEAD frv_sched_lookahead
-/* Return true if a function is ok to be called as a sibcall. */
-#define FUNCTION_OK_FOR_SIBCALL(DECL) 0
-
enum frv_builtins
{
FRV_BUILTIN_MAND,
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index eac88bde469..078c4a97651 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -23,6 +23,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "regs.h"
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index 21f3eeb689b..49c47ef7a23 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -1159,20 +1159,13 @@ struct cum_arg
#define USER_LABEL_PREFIX "_"
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class.
-
- N.B.: The h8300.md branch_true and branch_false patterns also know
- how to generate internal labels. */
-
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) \
- fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
-
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
- This is suitable for output with `assemble_name'. */
+ This is suitable for output with `assemble_name'.
+ N.B.: The h8300.md branch_true and branch_false patterns also know
+ how to generate internal labels. */
#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
sprintf (LABEL, "*.%s%d", PREFIX, NUM)
@@ -1238,13 +1231,7 @@ struct cum_arg
assemble_name ((FILE), (NAME)), \
fprintf ((FILE), ",%d\n", (SIZE)))
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
+#define ASM_PN_FORMAT "%s___%lu"
/* Print an instruction operand X on file FILE.
Look in h8300.c for details. */
diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md
index de6edc9b4d2..cf4e6a95cb1 100644
--- a/gcc/config/h8300/h8300.md
+++ b/gcc/config/h8300/h8300.md
@@ -353,7 +353,7 @@
|| register_operand (operands[1], SImode))"
"*
{
- int rn = -1;
+ unsigned int rn = -1;
switch (which_alternative)
{
case 0:
@@ -420,7 +420,7 @@
"*
{
/* Copy of the movsi stuff. */
- int rn = -1;
+ unsigned int rn = -1;
switch (which_alternative)
{
case 0:
diff --git a/gcc/config/i370/i370-c.c b/gcc/config/i370/i370-c.c
index 5651a5661c3..ab67c75e2c6 100644
--- a/gcc/config/i370/i370-c.c
+++ b/gcc/config/i370/i370-c.c
@@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "toplev.h"
#include "cpplib.h"
diff --git a/gcc/config/i370/i370.c b/gcc/config/i370/i370.c
index b4474db3273..3db961a6170 100644
--- a/gcc/config/i370/i370.c
+++ b/gcc/config/i370/i370.c
@@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "regs.h"
@@ -109,6 +111,7 @@ static void i370_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
static int mvs_hash_alias PARAMS ((const char *));
#endif
static void i370_encode_section_info PARAMS ((tree, int));
+static void i370_internal_label PARAMS ((FILE *, const char *, unsigned long));
/* ===================================================== */
/* defines and functions specific to the HLASM assembler */
@@ -312,6 +315,8 @@ static const unsigned char ebcasc[256] =
#define TARGET_ASM_FUNCTION_EPILOGUE i370_output_function_epilogue
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO i370_encode_section_info
+#undef TARGET_ASM_INTERNAL_LABEL
+#define TARGET_ASM_INTERNAL_LABEL i370_internal_label
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -1597,3 +1602,14 @@ i370_encode_section_info (decl, first)
SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
}
+static void
+i370_internal_label (stream, prefix, labelno)
+ FILE *stream;
+ const char *prefix;
+ unsigned long labelno;
+{
+ if (!strcmp (prefix, "L"))
+ mvs_add_label(labelno);
+
+ default_internal_label (stream, prefix, labelno);
+}
diff --git a/gcc/config/i370/i370.h b/gcc/config/i370/i370.h
index 23cf036b0df..802103315d2 100644
--- a/gcc/config/i370/i370.h
+++ b/gcc/config/i370/i370.h
@@ -656,12 +656,6 @@ enum reg_class
/* Addressing modes, and classification of registers for them. */
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
-
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
-
/* These assume that REGNO is a hard or pseudo reg number. They give
nonzero only if REGNO is a hard reg of the suitable class or a pseudo
reg currently allocated to a suitable hard reg.
@@ -1098,18 +1092,6 @@ enum reg_class
#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
sprintf (LABEL, "*%s%d", PREFIX, NUM)
-/* Generate internal label. Since we can branch here from off page, we
- must reload the base register. */
-
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) \
-{ \
- if (!strcmp (PREFIX,"L")) \
- { \
- mvs_add_label(NUM); \
- } \
- fprintf (FILE, "%s%d\tEQU\t*\n", PREFIX, NUM); \
-}
-
/* Generate case label. For HLASM we can change to the data CSECT
and put the vectors out of the code body. The assembler just
concatenates CSECTs with the same name. */
@@ -1258,15 +1240,7 @@ enum reg_class
ASM_OUTPUT_SKIP (FILE,SIZE); \
}
-/* Store in OUTPUT a string (made with alloca) containing an
- assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-{ \
- (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10); \
- sprintf ((OUTPUT), "%s%d", (NAME), (LABELNO)); \
-}
+#define ASM_PN_FORMAT "%s%lu"
/* Print operand XV (an rtx) in assembler syntax to file FILE.
CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
@@ -1837,19 +1811,6 @@ abort(); \
/* #define ASM_OUTPUT_LABELREF(FILE, NAME) */ /* use gas -- defaults.h */
-/* Generate internal label. Since we can branch here from off page, we
- must reload the base register. Note that internal labels are generated
- for loops, goto's and case labels. */
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) \
-{ \
- if (!strcmp (PREFIX,"L")) \
- { \
- mvs_add_label(NUM); \
- } \
- fprintf (FILE, ".%s%d:\n", PREFIX, NUM); \
-}
-
/* let config/svr4.h define this ...
* #define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, TABLE)
* fprintf (FILE, "%s%d:\n", PREFIX, NUM)
@@ -1886,11 +1847,7 @@ abort(); \
#undef SHIFT_DOUBLE_OMITS_COUNT
#define SHIFT_DOUBLE_OMITS_COUNT 0
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
- /* Implicit library calls should use memcpy, not bcopy, etc. */
+/* Implicit library calls should use memcpy, not bcopy, etc. */
#define TARGET_MEM_FUNCTIONS
/* Output before read-only data. */
diff --git a/gcc/config/i370/t-i370 b/gcc/config/i370/t-i370
index 34758d838fd..96138a1c372 100644
--- a/gcc/config/i370/t-i370
+++ b/gcc/config/i370/t-i370
@@ -1,3 +1,3 @@
-i370-c.o: $(srcdir)/config/i370/i370-c.c $(CONFIG_H) $(SYSTEM_H) cpplib.h \
- $(TREE_H) c-pragma.h toplev.h $(TM_P_H)
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+i370-c.o: $(srcdir)/config/i370/i370-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h
+ $(TM_H) $(TREE_H) toplev.h $(CPPLIB_H) c-pragma.h $(TM_P_H)
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i370/i370-c.c
diff --git a/gcc/config/i386/athlon.md b/gcc/config/i386/athlon.md
index 548f2adf422..719046fcd61 100644
--- a/gcc/config/i386/athlon.md
+++ b/gcc/config/i386/athlon.md
@@ -1,34 +1,5 @@
;; AMD Athlon Scheduling
-;; Copyright (C) 2002 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_attr "athlon_decode" "direct,vector"
- (cond [(eq_attr "type" "call,imul,idiv,other,multi,fcmov,fpspc,str,pop,cld,fcmov")
- (const_string "vector")
- (and (eq_attr "type" "push")
- (match_operand 1 "memory_operand" ""))
- (const_string "vector")
- (and (eq_attr "type" "fmov")
- (and (eq_attr "memory" "load,store")
- (eq_attr "mode" "XF")))
- (const_string "vector")]
- (const_string "direct")))
-
;; The Athlon does contain three pipelined FP units, three integer units and
;; three address generation units.
;;
@@ -46,161 +17,649 @@
;; The load/store queue unit is not attached to the schedulers but
;; communicates with all the execution units separately instead.
-(define_function_unit "athlon_vectordec" 1 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "athlon_decode" "vector"))
- 1 1)
-
-(define_function_unit "athlon_directdec" 3 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "athlon_decode" "direct"))
- 1 1)
-
-(define_function_unit "athlon_vectordec" 1 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "athlon_decode" "direct"))
- 1 1 [(eq_attr "athlon_decode" "vector")])
-
-(define_function_unit "athlon_ieu" 3 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "type" "alu1,negnot,alu,icmp,test,imov,imovx,lea,incdec,ishift,ishift1,rotate,rotate1,ibr,call,callv,icmov,cld,pop,setcc,push,pop"))
- 1 1)
-
-(define_function_unit "athlon_ieu" 3 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "type" "str"))
- 15 15)
-
-(define_function_unit "athlon_ieu" 3 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "type" "imul"))
- 5 0)
-
-(define_function_unit "athlon_ieu" 3 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "type" "idiv"))
- 42 0)
-
-(define_function_unit "athlon_muldiv" 1 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "type" "imul"))
- 5 0)
-
-(define_function_unit "athlon_muldiv" 1 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "type" "idiv"))
- 42 42)
-
-(define_attr "athlon_fpunits" "none,store,mul,add,muladd,any"
- (cond [(eq_attr "type" "fop,fcmp,fistp")
- (const_string "add")
- (eq_attr "type" "fmul,fdiv,fpspc,fsgn,fcmov")
- (const_string "mul")
- (and (eq_attr "type" "fmov") (eq_attr "memory" "store,both"))
- (const_string "store")
- (and (eq_attr "type" "fmov") (eq_attr "memory" "load"))
- (const_string "any")
+(define_attr "athlon_decode" "direct,vector"
+ (cond [(eq_attr "type" "call,imul,idiv,other,multi,fcmov,fpspc,str,pop,cld,leave")
+ (const_string "vector")
+ (and (eq_attr "type" "push")
+ (match_operand 1 "memory_operand" ""))
+ (const_string "vector")
(and (eq_attr "type" "fmov")
- (ior (match_operand:SI 1 "register_operand" "")
- (match_operand 1 "immediate_operand" "")))
- (const_string "store")
- (eq_attr "type" "fmov")
- (const_string "muladd")]
- (const_string "none")))
-
-;; We use latencies 1 for definitions. This is OK to model colisions
-;; in execution units. The real latencies are modeled in the "fp" pipeline.
-
-;; fsin, fcos: 96-192
-;; fsincos: 107-211
-;; fsqrt: 19 for SFmode, 27 for DFmode, 35 for XFmode.
-(define_function_unit "athlon_fp" 3 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "type" "fpspc"))
- 100 1)
-
-;; 16 cycles for SFmode, 20 for DFmode and 24 for XFmode.
-(define_function_unit "athlon_fp" 3 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "type" "fdiv"))
- 24 1)
-
-(define_function_unit "athlon_fp" 3 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "type" "fop,fmul,fistp"))
- 4 1)
-
-;; XFmode loads are slow.
-;; XFmode store is slow too (8 cycles), but we don't need to model it, because
-;; there are no dependent instructions.
+ (and (eq_attr "memory" "load,store")
+ (eq_attr "mode" "XF")))
+ (const_string "vector")]
+ (const_string "direct")))
-(define_function_unit "athlon_fp" 3 0
- (and (eq_attr "cpu" "athlon")
- (and (eq_attr "type" "fmov")
- (and (eq_attr "memory" "load")
- (eq_attr "mode" "XF"))))
- 10 1)
+;;
+;; decode0 decode1 decode2
+;; \ | /
+;; instruction control unit (72 entry scheduler)
+;; | |
+;; integer scheduler (18) stack map
+;; / | | | | \ stack rename
+;; ieu0 agu0 ieu1 agu1 ieu2 agu2 scheduler
+;; | agu0 | agu1 agu2 register file
+;; | \ | | / | | |
+;; \ /\ | / fadd fmul fstore
+;; \ / \ | / fadd fmul fstore
+;; imul load/store (2x) fadd fmul fstore
-(define_function_unit "athlon_fp" 3 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "type" "fmov,fsgn"))
- 2 1)
+(define_automaton "athlon,athlon_load,athlon_mult,athlon_fp")
+(define_cpu_unit "athlon-decode0" "athlon")
+(define_cpu_unit "athlon-decode1" "athlon")
+(define_cpu_unit "athlon-decode2" "athlon")
+(define_cpu_unit "athlon-decodev" "athlon")
+;; Model the fact that double decoded instruction may take 2 cycles
+;; to decode when decoder2 and decoder0 in next cycle
+;; is used (this is needed to allow troughput of 1.5 double decoded
+;; instructions per cycle).
+;;
+;; In order to avoid dependnece between reservation of decoder
+;; and other units, we model decoder as two stage fully pipelined unit
+;; and only double decoded instruction may occupy unit in the first cycle.
+;; With this scheme however two double instructions can be issued cycle0.
+;;
+;; Avoid this by using presence set requiring decoder0 to be allocated
+;; too. Vector decoded instructions then can't be issued when
+;; modeled as consuming decoder0+decoder1+decoder2.
+;; We solve that by specialized vector decoder unit and exclusion set.
+(presence_set "athlon-decode2" "athlon-decode0")
+(exclusion_set "athlon-decodev" "athlon-decode0,athlon-decode1,athlon-decode2")
+(define_reservation "athlon-vector" "nothing,athlon-decodev")
+(define_reservation "athlon-direct0" "nothing,athlon-decode0")
+(define_reservation "athlon-direct" "nothing,
+ (athlon-decode0 | athlon-decode1
+ | athlon-decode2)")
+;; Double instructions behaves like two direct instructions.
+(define_reservation "athlon-double" "((athlon-decode2, athlon-decode0)
+ | (nothing,(athlon-decode0 + athlon-decode1))
+ | (nothing,(athlon-decode1 + athlon-decode2)))")
-;; fcmp and ftst instructions
-(define_function_unit "athlon_fp" 3 0
- (and (eq_attr "cpu" "athlon")
- (and (eq_attr "type" "fcmp")
- (eq_attr "athlon_decode" "direct")))
- 3 1)
+;; Agu and ieu unit results in extremly large automatons and
+;; in our approximation they are hardly filled in. Only ieu
+;; unit can, as issue rate is 3 and agu unit is always used
+;; first in the insn reservations. Skip the models.
-;; fcmpi instructions.
-(define_function_unit "athlon_fp" 3 0
- (and (eq_attr "cpu" "athlon")
- (and (eq_attr "type" "fcmp")
- (eq_attr "athlon_decode" "vector")))
- 3 1)
+;(define_cpu_unit "athlon-ieu0" "athlon_ieu")
+;(define_cpu_unit "athlon-ieu1" "athlon_ieu")
+;(define_cpu_unit "athlon-ieu2" "athlon_ieu")
+;(define_reservation "athlon-ieu" "(athlon-ieu0 | athlon-ieu1 | athlon-ieu2)")
+(define_reservation "athlon-ieu" "nothing")
+(define_cpu_unit "athlon-ieu0" "athlon")
+;(define_cpu_unit "athlon-agu0" "athlon_agu")
+;(define_cpu_unit "athlon-agu1" "athlon_agu")
+;(define_cpu_unit "athlon-agu2" "athlon_agu")
+;(define_reservation "athlon-agu" "(athlon-agu0 | athlon-agu1 | athlon-agu2)")
+(define_reservation "athlon-agu" "nothing,nothing")
-(define_function_unit "athlon_fp" 3 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "type" "fcmov"))
- 7 1)
+(define_cpu_unit "athlon-mult" "athlon_mult")
-(define_function_unit "athlon_fp_mul" 1 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "athlon_fpunits" "mul"))
- 1 1)
+(define_cpu_unit "athlon-load0" "athlon_load")
+(define_cpu_unit "athlon-load1" "athlon_load")
+(define_reservation "athlon-load" "athlon-agu,
+ (athlon-load0 | athlon-load1)")
+(define_reservation "athlon-store" "nothing")
-(define_function_unit "athlon_fp_add" 1 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "athlon_fpunits" "add"))
- 1 1)
+;; The three fp units are fully pipelined with latency of 3
+(define_cpu_unit "athlon-fadd" "athlon_fp")
+(define_cpu_unit "athlon-fmul" "athlon_fp")
+(define_cpu_unit "athlon-fstore" "athlon_fp")
+(define_reservation "athlon-fany" "(athlon-fadd | athlon-fmul | athlon-fstore)")
+(define_reservation "athlon-faddmul" "(athlon-fadd | athlon-fmul)")
-(define_function_unit "athlon_fp_muladd" 2 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "athlon_fpunits" "muladd,mul,add"))
- 1 1)
-(define_function_unit "athlon_fp_store" 1 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "athlon_fpunits" "store"))
- 1 1)
+;; Jump instructions are executed in the branch unit compltetely transparent to us
+(define_insn_reservation "athlon_branch" 0
+ (and (eq_attr "cpu" "athlon,k8")
+ (eq_attr "type" "ibr"))
+ "athlon-direct")
+(define_insn_reservation "athlon_call" 0
+ (and (eq_attr "cpu" "athlon,k8")
+ (eq_attr "type" "call,callv"))
+ "athlon-vector")
-;; We don't need to model the Address Generation Unit, since we don't model
-;; the re-order buffer yet and thus we never schedule more than three operations
-;; at time. Later we may want to experiment with MD_SCHED macros modeling the
-;; decoders independently on the functional units.
+;; Latency of push operation is 3 cycles, but ESP value is available
+;; earlier
+(define_insn_reservation "athlon_push" 2
+ (and (eq_attr "cpu" "athlon,k8")
+ (eq_attr "type" "push"))
+ "athlon-direct,nothing,athlon-store")
+(define_insn_reservation "athlon_pop" 4
+ (and (eq_attr "cpu" "athlon,k8")
+ (eq_attr "type" "pop"))
+ "athlon-vector,athlon-ieu,athlon-load")
+(define_insn_reservation "athlon_pop_k8" 3
+ (and (eq_attr "cpu" "k8")
+ (eq_attr "type" "pop"))
+ "athlon-double,athlon-ieu,athlon-load")
+(define_insn_reservation "athlon_leave" 3
+ (and (eq_attr "cpu" "athlon")
+ (eq_attr "type" "leave"))
+ "athlon-vector,athlon-load")
+(define_insn_reservation "athlon_leave_k8" 3
+ (and (eq_attr "cpu" "k8")
+ (eq_attr "type" "leave"))
+ "athlon-double,athlon-load")
-;(define_function_unit "athlon_agu" 3 0
-; (and (eq_attr "cpu" "athlon")
-; (and (eq_attr "memory" "!none")
-; (eq_attr "athlon_fpunits" "none")))
-; 1 1)
+;; Lea executes in AGU unit with 2 cycles latency.
+(define_insn_reservation "athlon_lea" 2
+ (and (eq_attr "cpu" "athlon,k8")
+ (eq_attr "type" "lea"))
+ "athlon-direct,athlon-agu")
-;; Model load unit to avoid too long sequences of loads. We don't need to
-;; model store queue, since it is hardly going to be bottleneck.
+;; Mul executes in special multiplier unit attached to IEU0
+(define_insn_reservation "athlon_imul" 5
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "imul")
+ (eq_attr "memory" "none,unknown")))
+ "athlon-vector,athlon-ieu0,athlon-mult,nothing,nothing,athlon-ieu0")
+;; ??? Widening multiply is vector or double.
+(define_insn_reservation "athlon_imul_k8_DI" 4
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "imul")
+ (and (eq_attr "mode" "DI")
+ (eq_attr "memory" "none,unknown"))))
+ "athlon-direct0,athlon-ieu0,athlon-mult,nothing,athlon-ieu0")
+(define_insn_reservation "athlon_imul_k8" 3
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "imul")
+ (eq_attr "memory" "none,unknown")))
+ "athlon-direct0,athlon-ieu0,athlon-mult,athlon-ieu0")
+(define_insn_reservation "athlon_imul_mem" 8
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "imul")
+ (eq_attr "memory" "load,both")))
+ "athlon-vector,athlon-load,athlon-ieu,athlon-mult,nothing,nothing,athlon-ieu")
+(define_insn_reservation "athlon_imul_mem_k8_DI" 7
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "imul")
+ (and (eq_attr "mode" "DI")
+ (eq_attr "memory" "load,both"))))
+ "athlon-vector,athlon-load,athlon-ieu,athlon-mult,nothing,athlon-ieu")
+(define_insn_reservation "athlon_imul_mem_k8" 6
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "imul")
+ (eq_attr "memory" "load,both")))
+ "athlon-vector,athlon-load,athlon-ieu,athlon-mult,athlon-ieu")
+(define_insn_reservation "athlon_idiv" 42
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "idiv")
+ (eq_attr "memory" "none,unknown")))
+ "athlon-vector,athlon-ieu*42")
+(define_insn_reservation "athlon_idiv_mem" 45
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "idiv")
+ (eq_attr "memory" "load,both")))
+ "athlon-vector,athlon-load,athlon-ieu*42")
+(define_insn_reservation "athlon_str" 15
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "str")
+ (eq_attr "memory" "load,both,store")))
+ "athlon-vector,athlon-load,athlon-ieu*10")
-(define_function_unit "athlon_load" 2 0
- (and (eq_attr "cpu" "athlon")
- (eq_attr "memory" "load,both"))
- 1 1)
+(define_insn_reservation "athlon_idirect" 1
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "athlon_decode" "direct")
+ (and (eq_attr "unit" "integer,unknown")
+ (eq_attr "memory" "none,unknown"))))
+ "athlon-direct,athlon-ieu")
+(define_insn_reservation "athlon_ivector" 2
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "athlon_decode" "vector")
+ (and (eq_attr "unit" "integer,unknown")
+ (eq_attr "memory" "none,unknown"))))
+ "athlon-vector,athlon-ieu,athlon-ieu")
+(define_insn_reservation "athlon_idirect_loadmov" 3
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "imov")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-load")
+(define_insn_reservation "athlon_idirect_load" 4
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "athlon_decode" "direct")
+ (and (eq_attr "unit" "integer,unknown")
+ (eq_attr "memory" "load"))))
+ "athlon-direct,athlon-load,athlon-ieu")
+(define_insn_reservation "athlon_ivector_load" 6
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "athlon_decode" "vector")
+ (and (eq_attr "unit" "integer,unknown")
+ (eq_attr "memory" "load"))))
+ "athlon-vector,athlon-load,athlon-ieu,athlon-ieu")
+(define_insn_reservation "athlon_idirect_movstore" 1
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "imov")
+ (eq_attr "memory" "store")))
+ "athlon-direct,athlon-agu,athlon-store")
+(define_insn_reservation "athlon_idirect_both" 4
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "athlon_decode" "direct")
+ (and (eq_attr "unit" "integer,unknown")
+ (eq_attr "memory" "both"))))
+ "athlon-direct,athlon-load,athlon-ieu,
+ athlon-store")
+(define_insn_reservation "athlon_ivector_both" 6
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "athlon_decode" "vector")
+ (and (eq_attr "unit" "integer,unknown")
+ (eq_attr "memory" "both"))))
+ "athlon-vector,athlon-load,athlon-ieu,athlon-ieu,
+ athlon-store")
+(define_insn_reservation "athlon_idirect_store" 1
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "athlon_decode" "direct")
+ (and (eq_attr "unit" "integer,unknown")
+ (eq_attr "memory" "store"))))
+ "athlon-direct,athlon-ieu,
+ athlon-store")
+(define_insn_reservation "athlon_ivector_store" 2
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "athlon_decode" "vector")
+ (and (eq_attr "unit" "integer,unknown")
+ (eq_attr "memory" "store"))))
+ "athlon-vector,athlon-ieu,athlon-ieu,
+ athlon-store")
+;; Athlon floatin point unit
+(define_insn_reservation "athlon_fldxf" 12
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "fmov")
+ (and (eq_attr "memory" "load")
+ (eq_attr "mode" "XF"))))
+ "athlon-vector,athlon-fany")
+(define_insn_reservation "athlon_fldxf_k8" 13
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "fmov")
+ (and (eq_attr "memory" "load")
+ (eq_attr "mode" "XF"))))
+ "athlon-vector,athlon-fany")
+(define_insn_reservation "athlon_fld" 6
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "fmov")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-fany,nothing,athlon-load")
+(define_insn_reservation "athlon_fld_k8" 4
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "fmov")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-fany,athlon-load")
+(define_insn_reservation "athlon_fstxf" 10
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "fmov")
+ (and (eq_attr "memory" "store,both")
+ (eq_attr "mode" "XF"))))
+ "athlon-vector,athlon-fstore")
+(define_insn_reservation "athlon_fstxf_k8" 8
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "fmov")
+ (and (eq_attr "memory" "store,both")
+ (eq_attr "mode" "XF"))))
+ "athlon-vector,athlon-fstore")
+(define_insn_reservation "athlon_fst" 4
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "fmov")
+ (eq_attr "memory" "store,both")))
+ "athlon-direct,athlon-fstore,nothing,athlon-store")
+(define_insn_reservation "athlon_fst_k8" 2
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "fmov")
+ (eq_attr "memory" "store,both")))
+ "athlon-direct,athlon-fstore,athlon-store")
+(define_insn_reservation "athlon_fist" 4
+ (and (eq_attr "cpu" "athlon,k8")
+ (eq_attr "type" "fistp"))
+ "athlon-direct,athlon-fstore,nothing")
+(define_insn_reservation "athlon_fmov" 2
+ (and (eq_attr "cpu" "athlon,k8")
+ (eq_attr "type" "fmov"))
+ "athlon-direct,athlon-faddmul")
+(define_insn_reservation "athlon_fadd_load" 7
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "fop")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-load,athlon-fadd")
+(define_insn_reservation "athlon_fadd_load_k8" 6
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "fop")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-load,athlon-fadd")
+(define_insn_reservation "athlon_fadd" 4
+ (and (eq_attr "cpu" "athlon,k8")
+ (eq_attr "type" "fop"))
+ "athlon-direct,athlon-fadd")
+(define_insn_reservation "athlon_fmul_load" 7
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "fmul")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-load,athlon-fmul")
+(define_insn_reservation "athlon_fmul_load_k8" 6
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "fmul")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-load,athlon-fmul")
+(define_insn_reservation "athlon_fmul" 4
+ (and (eq_attr "cpu" "athlon,k8")
+ (eq_attr "type" "fmul"))
+ "athlon-direct,athlon-fmul")
+(define_insn_reservation "athlon_fsgn" 2
+ (and (eq_attr "cpu" "athlon,k8")
+ (eq_attr "type" "fsgn"))
+ "athlon-direct,athlon-fmul")
+(define_insn_reservation "athlon_fdiv_load" 24
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "fdiv")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-load,athlon-fmul")
+(define_insn_reservation "athlon_fdiv_load_k8" 13
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "fdiv")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-load,athlon-fmul")
+(define_insn_reservation "athlon_fdiv" 24
+ (and (eq_attr "cpu" "athlon")
+ (eq_attr "type" "fdiv"))
+ "athlon-direct,athlon-fmul")
+(define_insn_reservation "athlon_fdiv_k8" 11
+ (and (eq_attr "cpu" "k8")
+ (eq_attr "type" "fdiv"))
+ "athlon-direct,athlon-fmul")
+(define_insn_reservation "athlon_fpspc_load" 103
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "fpspc")
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-load,athlon-fmul")
+(define_insn_reservation "athlon_fpspc" 100
+ (and (eq_attr "cpu" "athlon,k8")
+ (eq_attr "type" "fpspc"))
+ "athlon-vector,athlon-fmul")
+(define_insn_reservation "athlon_fcmov_load" 10
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "fcmov")
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-load,athlon-fmul")
+(define_insn_reservation "athlon_fcmov" 7
+ (and (eq_attr "cpu" "athlon")
+ (eq_attr "type" "fcmov"))
+ "athlon-vector,athlon-fmul")
+(define_insn_reservation "athlon_fcmov_load_k8" 17
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "fcmov")
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-load,athlon-fmul")
+(define_insn_reservation "athlon_fcmov_k8" 15
+ (and (eq_attr "cpu" "k8")
+ (eq_attr "type" "fcmov"))
+ "athlon-vector,athlon-fmul")
+(define_insn_reservation "athlon_fcomi_load" 6
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "fcmp")
+ (and (eq_attr "athlon_decode" "vector")
+ (eq_attr "memory" "load"))))
+ "athlon-vector,athlon-load,athlon-fadd")
+(define_insn_reservation "athlon_fcomi" 3
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "athlon_decode" "vector")
+ (eq_attr "type" "fcmp")))
+ "athlon-vector,athlon-fadd")
+(define_insn_reservation "athlon_fcom_load" 5
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "fcmp")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-load,athlon-fadd")
+(define_insn_reservation "athlon_fcom" 2
+ (and (eq_attr "cpu" "athlon,k8")
+ (eq_attr "type" "fcmp"))
+ "athlon-direct,athlon-fadd")
+(define_insn_reservation "athlon_fxch" 2
+ (and (eq_attr "cpu" "athlon,k8")
+ (eq_attr "type" "fxch"))
+ "athlon-direct,athlon-fany")
+;; Athlon handle MMX operations in the FPU unit with shorter latencies
+(define_insn_reservation "athlon_movlpd_load" 4
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "ssemov")
+ (match_operand:DF 1 "memory_operand" "")))
+ "athlon-direct,athlon-load")
+(define_insn_reservation "athlon_movaps_load" 4
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "ssemov")
+ (and (eq_attr "mode" "V4SF,V2DF,TI")
+ (eq_attr "memory" "load"))))
+ "athlon-double,athlon-load")
+(define_insn_reservation "athlon_movss_load" 3
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "ssemov")
+ (and (eq_attr "mode" "SF,DI")
+ (eq_attr "memory" "load"))))
+ "athlon-double,athlon-load")
+(define_insn_reservation "athlon_mmxsseld" 4
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "mmxmov,ssemov")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-fany,athlon-load")
+(define_insn_reservation "athlon_mmxssest" 3
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "mmxmov,ssemov")
+ (and (eq_attr "mode" "V4SF,V2DF,TI")
+ (eq_attr "memory" "store,both"))))
+ "athlon-double,athlon-store")
+(define_insn_reservation "athlon_mmxssest_k8" 2
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "mmxmov,ssemov")
+ (eq_attr "memory" "store,both")))
+ "athlon-direct,athlon-store")
+(define_insn_reservation "athlon_movaps" 2
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "ssemov")
+ (eq_attr "mode" "V4SF,V2DF")))
+ "athlon-double,athlon-faddmul,athlon-faddmul")
+(define_insn_reservation "athlon_mmxssemov" 2
+ (and (eq_attr "cpu" "athlon,k8")
+ (eq_attr "type" "mmxmov,ssemov"))
+ "athlon-direct,athlon-faddmul")
+(define_insn_reservation "athlon_mmxmul_load" 6
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "mmxmul")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-load,athlon-fmul")
+(define_insn_reservation "athlon_mmxmul" 3
+ (and (eq_attr "cpu" "athlon,k8")
+ (eq_attr "type" "mmxmul"))
+ "athlon-direct,athlon-fmul")
+(define_insn_reservation "athlon_mmx_load" 5
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "unit" "mmx")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-load,athlon-faddmul")
+(define_insn_reservation "athlon_mmx" 2
+ (and (eq_attr "cpu" "athlon,k8")
+ (eq_attr "unit" "mmx"))
+ "athlon-direct,athlon-faddmul")
+;; SSE operations are handled by the i387 unit as well. The latnecy
+;; is same as for i387 operations for scalar operations
+(define_insn_reservation "athlon_sselog_load" 6
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "sselog")
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-load,athlon-fmul")
+(define_insn_reservation "athlon_sselog_load_k8" 5
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "sselog")
+ (eq_attr "memory" "load")))
+ "athlon-double,athlon-load,athlon-fmul")
+(define_insn_reservation "athlon_sselog" 3
+ (and (eq_attr "cpu" "athlon")
+ (eq_attr "type" "sselog"))
+ "athlon-vector,athlon-fmul")
+(define_insn_reservation "athlon_sselog_k8" 3
+ (and (eq_attr "cpu" "k8")
+ (eq_attr "type" "sselog"))
+ "athlon-double,athlon-fmul")
+(define_insn_reservation "athlon_ssecmp_load" 5
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "ssecmp")
+ (and (eq_attr "mode" "SF,DF")
+ (eq_attr "memory" "load"))))
+ "athlon-vector,athlon-load,athlon-fadd")
+(define_insn_reservation "athlon_ssecmp" 2
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "ssecmp")
+ (eq_attr "mode" "SF,DF")))
+ "athlon-direct,athlon-fadd")
+(define_insn_reservation "athlon_ssecmpvector_load" 6
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "ssecmp")
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-fadd")
+(define_insn_reservation "athlon_ssecmpvector_load_k8" 5
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "ssecmp")
+ (eq_attr "memory" "load")))
+ "athlon-double,athlon-fadd")
+(define_insn_reservation "athlon_ssecmpvector" 3
+ (and (eq_attr "cpu" "athlon")
+ (eq_attr "type" "ssecmp"))
+ "athlon-vector,athlon-fadd")
+(define_insn_reservation "athlon_ssecmpvector_k8" 3
+ (and (eq_attr "cpu" "k8")
+ (eq_attr "type" "ssecmp"))
+ "athlon-double,athlon-fadd")
+(define_insn_reservation "athlon_sseadd_load" 7
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "sseadd")
+ (and (eq_attr "mode" "SF,DF")
+ (eq_attr "memory" "load"))))
+ "athlon-direct,athlon-load,athlon-fadd")
+(define_insn_reservation "athlon_sseadd_load_k8" 6
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "sseadd")
+ (and (eq_attr "mode" "SF,DF")
+ (eq_attr "memory" "load"))))
+ "athlon-direct,athlon-load,athlon-fadd")
+(define_insn_reservation "athlon_sseadd" 4
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "sseadd")
+ (eq_attr "mode" "SF,DF")))
+ "athlon-direct,athlon-fadd")
+(define_insn_reservation "athlon_sseaddvector_load" 8
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "sseadd")
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-load,athlon-fadd")
+(define_insn_reservation "athlon_sseaddvector_load_k8" 7
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "sseadd")
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-load,athlon-fadd")
+(define_insn_reservation "athlon_sseaddvector" 5
+ (and (eq_attr "cpu" "athlon")
+ (eq_attr "type" "sseadd"))
+ "athlon-vector,athlon-fadd")
+(define_insn_reservation "athlon_sseaddvector_k8" 4
+ (and (eq_attr "cpu" "k8")
+ (eq_attr "type" "sseadd"))
+ "athlon-vector,athlon-fadd")
+(define_insn_reservation "athlon_ssecvt_load" 5
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "ssecvt")
+ (and (eq_attr "mode" "SF,DF")
+ (eq_attr "memory" "load"))))
+ "athlon-direct,athlon-load,athlon-fadd")
+(define_insn_reservation "athlon_ssecvt_load_k8" 4
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "ssecvt")
+ (and (eq_attr "mode" "SF,DF")
+ (eq_attr "memory" "load"))))
+ "athlon-direct,athlon-load,athlon-fadd")
+(define_insn_reservation "athlon_ssecvt" 2
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "ssecvt")
+ (eq_attr "mode" "SF,DF")))
+ "athlon-direct,athlon-fadd")
+(define_insn_reservation "athlon_ssecvtvector_load" 6
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "ssecvt")
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-load,athlon-fadd")
+(define_insn_reservation "athlon_ssecvtvector_load_k8" 5
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "ssecvt")
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-load,athlon-fadd")
+(define_insn_reservation "athlon_ssecvtvector" 5
+ (and (eq_attr "cpu" "athlon")
+ (eq_attr "type" "ssecvt"))
+ "athlon-vector,athlon-fadd")
+(define_insn_reservation "athlon_ssecvtvector_k8" 3
+ (and (eq_attr "cpu" "k8")
+ (eq_attr "type" "ssecvt"))
+ "athlon-vector,athlon-fadd")
+(define_insn_reservation "athlon_ssemul_load" 7
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "ssemul")
+ (and (eq_attr "mode" "SF,DF")
+ (eq_attr "memory" "load"))))
+ "athlon-direct,athlon-load,athlon-fmul")
+(define_insn_reservation "athlon_ssemul_load_k8" 6
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "ssemul")
+ (and (eq_attr "mode" "SF,DF")
+ (eq_attr "memory" "load"))))
+ "athlon-direct,athlon-load,athlon-fmul")
+(define_insn_reservation "athlon_ssemul" 4
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "ssemul")
+ (eq_attr "mode" "SF,DF")))
+ "athlon-direct,athlon-fmul")
+(define_insn_reservation "athlon_ssemulvector_load" 8
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "ssemul")
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-load,athlon-fmul")
+(define_insn_reservation "athlon_ssemulvector_load_k8" 7
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "ssemul")
+ (eq_attr "memory" "load")))
+ "athlon-double,athlon-load,athlon-fmul")
+(define_insn_reservation "athlon_ssemulvector" 5
+ (and (eq_attr "cpu" "athlon")
+ (eq_attr "type" "ssemul"))
+ "athlon-vector,athlon-fmul")
+(define_insn_reservation "athlon_ssemulvector_k8" 5
+ (and (eq_attr "cpu" "k8")
+ (eq_attr "type" "ssemul"))
+ "athlon-double,athlon-fmul")
+(define_insn_reservation "athlon_ssediv_load" 19
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "ssediv")
+ (and (eq_attr "mode" "SF,DF")
+ (eq_attr "memory" "load"))))
+ "athlon-direct,athlon-load,athlon-fmul")
+(define_insn_reservation "athlon_ssediv_load_k8" 18
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "ssediv")
+ (and (eq_attr "mode" "SF,DF")
+ (eq_attr "memory" "load"))))
+ "athlon-direct,athlon-load,athlon-fmul")
+(define_insn_reservation "athlon_ssediv" 16
+ (and (eq_attr "cpu" "athlon,k8")
+ (and (eq_attr "type" "ssediv")
+ (eq_attr "mode" "SF,DF")))
+ "athlon-direct,athlon-fmul")
+(define_insn_reservation "athlon_ssedivvector_load" 32
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "ssediv")
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-load,athlon-fmul")
+(define_insn_reservation "athlon_ssedivvector_load_k8" 35
+ (and (eq_attr "cpu" "k8")
+ (and (eq_attr "type" "ssediv")
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-load,athlon-fmul")
+(define_insn_reservation "athlon_ssedivvector" 29
+ (and (eq_attr "cpu" "athlon")
+ (eq_attr "type" "ssediv"))
+ "athlon-vector,athlon-fmul")
+(define_insn_reservation "athlon_ssedivvector_k8" 33
+ (and (eq_attr "cpu" "k8")
+ (eq_attr "type" "ssediv"))
+ "athlon-vector,athlon-fmul")
diff --git a/gcc/config/i386/att.h b/gcc/config/i386/att.h
index 70ae1641365..8d9930852f7 100644
--- a/gcc/config/i386/att.h
+++ b/gcc/config/i386/att.h
@@ -90,13 +90,6 @@ do \
#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \
sprintf ((BUF), "%s%s%ld", LOCAL_LABEL_PREFIX, (PREFIX), (long)(NUMBER))
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, "%s%s%d:\n", LOCAL_LABEL_PREFIX, PREFIX, NUM)
-
/* The prefix to add to user-visible assembler symbols. */
#undef USER_LABEL_PREFIX
diff --git a/gcc/config/i386/bsd.h b/gcc/config/i386/bsd.h
index 69ad1688bfb..9f396ec46ae 100644
--- a/gcc/config/i386/bsd.h
+++ b/gcc/config/i386/bsd.h
@@ -88,12 +88,6 @@ Boston, MA 02111-1307, USA. */
#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \
sprintf ((BUF), "*%s%ld", (PREFIX), (long)(NUMBER))
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, "%s%d:\n", PREFIX, NUM)
-
/* The prefix to add to user-visible assembler symbols. */
#define USER_LABEL_PREFIX "_"
diff --git a/gcc/config/i386/freebsd-aout.h b/gcc/config/i386/freebsd-aout.h
index a2b616e700b..646cf13b5d8 100644
--- a/gcc/config/i386/freebsd-aout.h
+++ b/gcc/config/i386/freebsd-aout.h
@@ -198,7 +198,8 @@ do { \
ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
} while (0)
-#define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k}"
+#define AS_NEEDS_DASH_FOR_PIPED_INPUT
+#define ASM_SPEC "%{fpic:-k} %{fPIC:-k}"
#define LINK_SPEC \
"%{p:%e`-p' not supported; use `-pg' and gprof(1)} \
%{shared:-Bshareable} \
diff --git a/gcc/config/i386/i386-coff.h b/gcc/config/i386/i386-coff.h
index e8c5de9c65c..a4bb04ad729 100644
--- a/gcc/config/i386/i386-coff.h
+++ b/gcc/config/i386/i386-coff.h
@@ -60,11 +60,4 @@ Boston, MA 02111-1307, USA. */
#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \
sprintf ((BUF), ".%s%ld", (PREFIX), (long)(NUMBER))
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
-
/* end of i386-coff.h */
diff --git a/gcc/config/i386/i386-interix.h b/gcc/config/i386/i386-interix.h
index d309087217d..7e2290f2d3a 100644
--- a/gcc/config/i386/i386-interix.h
+++ b/gcc/config/i386/i386-interix.h
@@ -35,11 +35,12 @@ Boston, MA 02111-1307, USA. */
/* By default, target has a 80387, uses IEEE compatible arithmetic,
and returns float values in the 387 and needs stack probes
- We also align doubles to 64-bits for MSVC default compatibility */
+ We also align doubles to 64-bits for MSVC default compatibility
+ We do bitfields MSVC-compatably by default, too. */
#undef TARGET_SUBTARGET_DEFAULT
#define TARGET_SUBTARGET_DEFAULT \
(MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_STACK_PROBE | \
- MASK_ALIGN_DOUBLE)
+ MASK_ALIGN_DOUBLE | MASK_MS_BITFIELD_LAYOUT)
#undef TARGET_CPU_DEFAULT
#define TARGET_CPU_DEFAULT 2 /* 486 */
@@ -243,6 +244,28 @@ Boston, MA 02111-1307, USA. */
#define TARGET_NOP_FUN_DLLIMPORT 1
#define drectve_section() /* nothing */
+/* Objective C has its own packing rules...
+ Objc tries to parallel the code in stor-layout.c at runtime
+ (see libobjc/encoding.c). This (compile-time) packing info isn't
+ available at runtime, so it's hopeless to try.
+
+ And if the user tries to set the flag for objc, give an error
+ so he has some clue. */
+
+#undef SUBTARGET_OVERRIDE_OPTIONS
+#define SUBTARGET_OVERRIDE_OPTIONS \
+do { \
+ if (strcmp (lang_hooks.name, "GNU Objective-C") == 0) \
+ { \
+ if ((target_flags & MASK_MS_BITFIELD_LAYOUT) != 0 \
+ && (target_flags_explicit & MASK_MS_BITFIELD_LAYOUT) != 0) \
+ { \
+ error ("ms-bitfields not supported for objc"); \
+ } \
+ target_flags &= ~MASK_MS_BITFIELD_LAYOUT; \
+ } \
+} while (0)
+
#define EH_FRAME_IN_DATA_SECTION
#define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rdata,\"r\""
@@ -273,8 +296,6 @@ while (0)
#define HOST_PTR_AS_INT unsigned long
#define PCC_BITFIELD_TYPE_MATTERS 1
-#define PCC_BITFIELD_TYPE_TEST TYPE_NATIVE(rec)
-#define GROUP_BITFIELDS_BY_ALIGN TYPE_NATIVE(rec)
/* The following two flags are usually "off" for i386, because some non-gnu
tools (for the i386) don't handle them. However, we don't have that
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index 4afdf668bd8..e403950ab32 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -41,6 +41,9 @@ extern int ix86_aligned_p PARAMS ((rtx));
extern int standard_80387_constant_p PARAMS ((rtx));
extern int standard_sse_constant_p PARAMS ((rtx));
extern int symbolic_reference_mentioned_p PARAMS ((rtx));
+extern bool extended_reg_mentioned_p PARAMS ((rtx));
+extern bool x86_extended_QIreg_mentioned_p PARAMS ((rtx));
+extern bool x86_extended_reg_mentioned_p PARAMS ((rtx));
extern int any_fp_register_operand PARAMS ((rtx, enum machine_mode));
extern int register_and_not_any_fp_reg_operand PARAMS ((rtx, enum machine_mode));
@@ -63,6 +66,7 @@ extern int initial_exec_symbolic_operand PARAMS ((rtx, enum machine_mode));
extern int local_exec_symbolic_operand PARAMS ((rtx, enum machine_mode));
extern int pic_symbolic_operand PARAMS ((rtx, enum machine_mode));
extern int call_insn_operand PARAMS ((rtx, enum machine_mode));
+extern int sibcall_insn_operand PARAMS ((rtx, enum machine_mode));
extern int constant_call_address_operand PARAMS ((rtx, enum machine_mode));
extern int const0_operand PARAMS ((rtx, enum machine_mode));
extern int const1_operand PARAMS ((rtx, enum machine_mode));
@@ -137,7 +141,7 @@ extern void ix86_expand_branch PARAMS ((enum rtx_code, rtx));
extern int ix86_expand_setcc PARAMS ((enum rtx_code, rtx));
extern int ix86_expand_int_movcc PARAMS ((rtx[]));
extern int ix86_expand_fp_movcc PARAMS ((rtx[]));
-extern void ix86_expand_call PARAMS ((rtx, rtx, rtx, rtx, rtx));
+extern void ix86_expand_call PARAMS ((rtx, rtx, rtx, rtx, rtx, int));
extern void x86_initialize_trampoline PARAMS ((rtx, rtx, rtx));
extern rtx ix86_zero_extend_to_Pmode PARAMS ((rtx));
extern void ix86_split_long_move PARAMS ((rtx[]));
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 42f6d93d3c3..2eaa1c54875 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "tm_p.h"
@@ -55,9 +57,9 @@ struct processor_costs size_cost = { /* costs for tunning for size */
3, /* cost of a lea instruction */
2, /* variable shift costs */
3, /* constant shift costs */
- 3, /* cost of starting a multiply */
+ {3, 3, 3, 3, 5}, /* cost of starting a multiply */
0, /* cost of multiply per each bit set */
- 3, /* cost of a divide/mod */
+ {3, 3, 3, 3, 5}, /* cost of a divide/mod */
3, /* cost of movsx */
3, /* cost of movzx */
0, /* "large" insn */
@@ -84,6 +86,7 @@ struct processor_costs size_cost = { /* costs for tunning for size */
3, /* MMX or SSE register to integer */
0, /* size of prefetch block */
0, /* number of parallel prefetches */
+ 1, /* Branch cost */
2, /* cost of FADD and FSUB insns. */
2, /* cost of FMUL instruction. */
2, /* cost of FDIV instruction. */
@@ -99,9 +102,9 @@ struct processor_costs i386_cost = { /* 386 specific costs */
1, /* cost of a lea instruction */
3, /* variable shift costs */
2, /* constant shift costs */
- 6, /* cost of starting a multiply */
+ {6, 6, 6, 6, 6}, /* cost of starting a multiply */
1, /* cost of multiply per each bit set */
- 23, /* cost of a divide/mod */
+ {23, 23, 23, 23, 23}, /* cost of a divide/mod */
3, /* cost of movsx */
2, /* cost of movzx */
15, /* "large" insn */
@@ -128,6 +131,7 @@ struct processor_costs i386_cost = { /* 386 specific costs */
3, /* MMX or SSE register to integer */
0, /* size of prefetch block */
0, /* number of parallel prefetches */
+ 1, /* Branch cost */
23, /* cost of FADD and FSUB insns. */
27, /* cost of FMUL instruction. */
88, /* cost of FDIV instruction. */
@@ -142,9 +146,9 @@ struct processor_costs i486_cost = { /* 486 specific costs */
1, /* cost of a lea instruction */
3, /* variable shift costs */
2, /* constant shift costs */
- 12, /* cost of starting a multiply */
+ {12, 12, 12, 12, 12}, /* cost of starting a multiply */
1, /* cost of multiply per each bit set */
- 40, /* cost of a divide/mod */
+ {40, 40, 40, 40, 40}, /* cost of a divide/mod */
3, /* cost of movsx */
2, /* cost of movzx */
15, /* "large" insn */
@@ -171,6 +175,7 @@ struct processor_costs i486_cost = { /* 486 specific costs */
3, /* MMX or SSE register to integer */
0, /* size of prefetch block */
0, /* number of parallel prefetches */
+ 1, /* Branch cost */
8, /* cost of FADD and FSUB insns. */
16, /* cost of FMUL instruction. */
73, /* cost of FDIV instruction. */
@@ -185,9 +190,9 @@ struct processor_costs pentium_cost = {
1, /* cost of a lea instruction */
4, /* variable shift costs */
1, /* constant shift costs */
- 11, /* cost of starting a multiply */
+ {11, 11, 11, 11, 11}, /* cost of starting a multiply */
0, /* cost of multiply per each bit set */
- 25, /* cost of a divide/mod */
+ {25, 25, 25, 25, 25}, /* cost of a divide/mod */
3, /* cost of movsx */
2, /* cost of movzx */
8, /* "large" insn */
@@ -214,6 +219,7 @@ struct processor_costs pentium_cost = {
3, /* MMX or SSE register to integer */
0, /* size of prefetch block */
0, /* number of parallel prefetches */
+ 2, /* Branch cost */
3, /* cost of FADD and FSUB insns. */
3, /* cost of FMUL instruction. */
39, /* cost of FDIV instruction. */
@@ -228,9 +234,9 @@ struct processor_costs pentiumpro_cost = {
1, /* cost of a lea instruction */
1, /* variable shift costs */
1, /* constant shift costs */
- 4, /* cost of starting a multiply */
+ {4, 4, 4, 4, 4}, /* cost of starting a multiply */
0, /* cost of multiply per each bit set */
- 17, /* cost of a divide/mod */
+ {17, 17, 17, 17, 17}, /* cost of a divide/mod */
1, /* cost of movsx */
1, /* cost of movzx */
8, /* "large" insn */
@@ -257,6 +263,7 @@ struct processor_costs pentiumpro_cost = {
3, /* MMX or SSE register to integer */
32, /* size of prefetch block */
6, /* number of parallel prefetches */
+ 2, /* Branch cost */
3, /* cost of FADD and FSUB insns. */
5, /* cost of FMUL instruction. */
56, /* cost of FDIV instruction. */
@@ -271,9 +278,9 @@ struct processor_costs k6_cost = {
2, /* cost of a lea instruction */
1, /* variable shift costs */
1, /* constant shift costs */
- 3, /* cost of starting a multiply */
+ {3, 3, 3, 3, 3}, /* cost of starting a multiply */
0, /* cost of multiply per each bit set */
- 18, /* cost of a divide/mod */
+ {18, 18, 18, 18, 18}, /* cost of a divide/mod */
2, /* cost of movsx */
2, /* cost of movzx */
8, /* "large" insn */
@@ -300,6 +307,7 @@ struct processor_costs k6_cost = {
6, /* MMX or SSE register to integer */
32, /* size of prefetch block */
1, /* number of parallel prefetches */
+ 1, /* Branch cost */
2, /* cost of FADD and FSUB insns. */
2, /* cost of FMUL instruction. */
56, /* cost of FDIV instruction. */
@@ -314,9 +322,9 @@ struct processor_costs athlon_cost = {
2, /* cost of a lea instruction */
1, /* variable shift costs */
1, /* constant shift costs */
- 5, /* cost of starting a multiply */
+ {5, 5, 5, 5, 5}, /* cost of starting a multiply */
0, /* cost of multiply per each bit set */
- 42, /* cost of a divide/mod */
+ {18, 26, 42, 74, 74}, /* cost of a divide/mod */
1, /* cost of movsx */
1, /* cost of movzx */
8, /* "large" insn */
@@ -343,6 +351,7 @@ struct processor_costs athlon_cost = {
5, /* MMX or SSE register to integer */
64, /* size of prefetch block */
6, /* number of parallel prefetches */
+ 2, /* Branch cost */
4, /* cost of FADD and FSUB insns. */
4, /* cost of FMUL instruction. */
24, /* cost of FDIV instruction. */
@@ -352,14 +361,58 @@ struct processor_costs athlon_cost = {
};
static const
+struct processor_costs k8_cost = {
+ 1, /* cost of an add instruction */
+ 2, /* cost of a lea instruction */
+ 1, /* variable shift costs */
+ 1, /* constant shift costs */
+ {3, 4, 3, 4, 5}, /* cost of starting a multiply */
+ 0, /* cost of multiply per each bit set */
+ {18, 26, 42, 74, 74}, /* cost of a divide/mod */
+ 1, /* cost of movsx */
+ 1, /* cost of movzx */
+ 8, /* "large" insn */
+ 9, /* MOVE_RATIO */
+ 4, /* cost for loading QImode using movzbl */
+ {3, 4, 3}, /* cost of loading integer registers
+ in QImode, HImode and SImode.
+ Relative to reg-reg move (2). */
+ {3, 4, 3}, /* cost of storing integer registers */
+ 4, /* cost of reg,reg fld/fst */
+ {4, 4, 12}, /* cost of loading fp registers
+ in SFmode, DFmode and XFmode */
+ {6, 6, 8}, /* cost of loading integer registers */
+ 2, /* cost of moving MMX register */
+ {3, 3}, /* cost of loading MMX registers
+ in SImode and DImode */
+ {4, 4}, /* cost of storing MMX registers
+ in SImode and DImode */
+ 2, /* cost of moving SSE register */
+ {4, 3, 6}, /* cost of loading SSE registers
+ in SImode, DImode and TImode */
+ {4, 4, 5}, /* cost of storing SSE registers
+ in SImode, DImode and TImode */
+ 5, /* MMX or SSE register to integer */
+ 64, /* size of prefetch block */
+ 6, /* number of parallel prefetches */
+ 2, /* Branch cost */
+ 4, /* cost of FADD and FSUB insns. */
+ 4, /* cost of FMUL instruction. */
+ 19, /* cost of FDIV instruction. */
+ 2, /* cost of FABS instruction. */
+ 2, /* cost of FCHS instruction. */
+ 35, /* cost of FSQRT instruction. */
+};
+
+static const
struct processor_costs pentium4_cost = {
1, /* cost of an add instruction */
1, /* cost of a lea instruction */
- 8, /* variable shift costs */
- 8, /* constant shift costs */
- 30, /* cost of starting a multiply */
+ 4, /* variable shift costs */
+ 4, /* constant shift costs */
+ {15, 15, 15, 15, 15}, /* cost of starting a multiply */
0, /* cost of multiply per each bit set */
- 112, /* cost of a divide/mod */
+ {56, 56, 56, 56, 56}, /* cost of a divide/mod */
1, /* cost of movsx */
1, /* cost of movzx */
16, /* "large" insn */
@@ -386,6 +439,7 @@ struct processor_costs pentium4_cost = {
10, /* MMX or SSE register to integer */
64, /* size of prefetch block */
6, /* number of parallel prefetches */
+ 2, /* Branch cost */
5, /* cost of FADD and FSUB insns. */
7, /* cost of FMUL instruction. */
43, /* cost of FDIV instruction. */
@@ -404,52 +458,66 @@ const struct processor_costs *ix86_cost = &pentium_cost;
#define m_K6 (1<<PROCESSOR_K6)
#define m_ATHLON (1<<PROCESSOR_ATHLON)
#define m_PENT4 (1<<PROCESSOR_PENTIUM4)
+#define m_K8 (1<<PROCESSOR_K8)
+#define m_ATHLON_K8 (m_K8 | m_ATHLON)
-const int x86_use_leave = m_386 | m_K6 | m_ATHLON;
-const int x86_push_memory = m_386 | m_K6 | m_ATHLON | m_PENT4;
+const int x86_use_leave = m_386 | m_K6 | m_ATHLON_K8;
+const int x86_push_memory = m_386 | m_K6 | m_ATHLON_K8 | m_PENT4;
const int x86_zero_extend_with_and = m_486 | m_PENT;
-const int x86_movx = m_ATHLON | m_PPRO | m_PENT4 /* m_386 | m_K6 */;
+const int x86_movx = m_ATHLON_K8 | m_PPRO | m_PENT4 /* m_386 | m_K6 */;
const int x86_double_with_add = ~m_386;
const int x86_use_bit_test = m_386;
-const int x86_unroll_strlen = m_486 | m_PENT | m_PPRO | m_ATHLON | m_K6;
-const int x86_cmove = m_PPRO | m_ATHLON | m_PENT4;
-const int x86_3dnow_a = m_ATHLON;
-const int x86_deep_branch = m_PPRO | m_K6 | m_ATHLON | m_PENT4;
+const int x86_unroll_strlen = m_486 | m_PENT | m_PPRO | m_ATHLON_K8 | m_K6;
+const int x86_cmove = m_PPRO | m_ATHLON_K8 | m_PENT4;
+const int x86_3dnow_a = m_ATHLON_K8;
+const int x86_deep_branch = m_PPRO | m_K6 | m_ATHLON_K8 | m_PENT4;
const int x86_branch_hints = m_PENT4;
const int x86_use_sahf = m_PPRO | m_K6 | m_PENT4;
const int x86_partial_reg_stall = m_PPRO;
const int x86_use_loop = m_K6;
-const int x86_use_fiop = ~(m_PPRO | m_ATHLON | m_PENT);
+const int x86_use_fiop = ~(m_PPRO | m_ATHLON_K8 | m_PENT);
const int x86_use_mov0 = m_K6;
const int x86_use_cltd = ~(m_PENT | m_K6);
const int x86_read_modify_write = ~m_PENT;
const int x86_read_modify = ~(m_PENT | m_PPRO);
const int x86_split_long_moves = m_PPRO;
-const int x86_promote_QImode = m_K6 | m_PENT | m_386 | m_486 | m_ATHLON;
+const int x86_promote_QImode = m_K6 | m_PENT | m_386 | m_486 | m_ATHLON_K8;
const int x86_fast_prefix = ~(m_PENT | m_486 | m_386);
const int x86_single_stringop = m_386 | m_PENT4;
const int x86_qimode_math = ~(0);
const int x86_promote_qi_regs = 0;
const int x86_himode_math = ~(m_PPRO);
const int x86_promote_hi_regs = m_PPRO;
-const int x86_sub_esp_4 = m_ATHLON | m_PPRO | m_PENT4;
-const int x86_sub_esp_8 = m_ATHLON | m_PPRO | m_386 | m_486 | m_PENT4;
-const int x86_add_esp_4 = m_ATHLON | m_K6 | m_PENT4;
-const int x86_add_esp_8 = m_ATHLON | m_PPRO | m_K6 | m_386 | m_486 | m_PENT4;
-const int x86_integer_DFmode_moves = ~(m_ATHLON | m_PENT4 | m_PPRO);
-const int x86_partial_reg_dependency = m_ATHLON | m_PENT4;
-const int x86_memory_mismatch_stall = m_ATHLON | m_PENT4;
-const int x86_accumulate_outgoing_args = m_ATHLON | m_PENT4 | m_PPRO;
-const int x86_prologue_using_move = m_ATHLON | m_PENT4 | m_PPRO;
-const int x86_epilogue_using_move = m_ATHLON | m_PENT4 | m_PPRO;
+const int x86_sub_esp_4 = m_ATHLON_K8 | m_PPRO | m_PENT4;
+const int x86_sub_esp_8 = m_ATHLON_K8 | m_PPRO | m_386 | m_486 | m_PENT4;
+const int x86_add_esp_4 = m_ATHLON_K8 | m_K6 | m_PENT4;
+const int x86_add_esp_8 = m_ATHLON_K8 | m_PPRO | m_K6 | m_386 | m_486 | m_PENT4;
+const int x86_integer_DFmode_moves = ~(m_ATHLON_K8 | m_PENT4 | m_PPRO);
+const int x86_partial_reg_dependency = m_ATHLON_K8 | m_PENT4;
+const int x86_memory_mismatch_stall = m_ATHLON_K8 | m_PENT4;
+const int x86_accumulate_outgoing_args = m_ATHLON_K8 | m_PENT4 | m_PPRO;
+const int x86_prologue_using_move = m_ATHLON_K8 | m_PENT4 | m_PPRO;
+const int x86_epilogue_using_move = m_ATHLON_K8 | m_PENT4 | m_PPRO;
const int x86_decompose_lea = m_PENT4;
const int x86_shift1 = ~m_486;
-const int x86_arch_always_fancy_math_387 = m_PENT | m_PPRO | m_ATHLON | m_PENT4;
+const int x86_arch_always_fancy_math_387 = m_PENT | m_PPRO | m_ATHLON_K8 | m_PENT4;
+const int x86_sse_partial_reg_dependency = m_PENT4 | m_PPRO;
+/* Set for machines where the type and dependencies are resolved on SSE register
+ parts insetad of whole registers, so we may maintain just lower part of
+ scalar values in proper format leaving the upper part undefined. */
+const int x86_sse_partial_regs = m_ATHLON_K8;
+/* Athlon optimizes partial-register FPS special case, thus avoiding the
+ need for extra instructions beforehand */
+const int x86_sse_partial_regs_for_cvtsd2ss = 0;
+const int x86_sse_typeless_stores = m_ATHLON_K8;
+const int x86_sse_load0_by_pxor = m_PPRO | m_PENT4;
+const int x86_use_ffreep = m_ATHLON_K8;
+const int x86_rep_movl_optimal = m_386 | m_PENT | m_PPRO | m_K6;
/* In case the avreage insn count for single function invocation is
lower than this constant, emit fast (but longer) prologue and
epilogue code. */
-#define FAST_PROLOGUE_INSN_COUNT 30
+#define FAST_PROLOGUE_INSN_COUNT 20
/* Set by prologue expander and used by epilogue expander to determine
the style used. */
@@ -755,6 +823,7 @@ static void x86_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
static bool x86_can_output_mi_thunk PARAMS ((tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
+bool ix86_expand_carry_flag_compare PARAMS ((enum rtx_code, rtx, rtx, rtx*));
struct ix86_address
{
@@ -796,9 +865,12 @@ static void ix86_compute_frame_layout PARAMS ((struct ix86_frame *));
static int ix86_comp_type_attributes PARAMS ((tree, tree));
static int ix86_fntype_regparm PARAMS ((tree));
const struct attribute_spec ix86_attribute_table[];
+static bool ix86_function_ok_for_sibcall PARAMS ((tree, tree));
static tree ix86_handle_cdecl_attribute PARAMS ((tree *, tree, tree, int, bool *));
static tree ix86_handle_regparm_attribute PARAMS ((tree *, tree, tree, int, bool *));
static int ix86_value_regno PARAMS ((enum machine_mode));
+static bool ix86_ms_bitfield_layout_p PARAMS ((tree));
+static int extended_reg_mentioned_1 PARAMS ((rtx *, void *));
#if defined (DO_GLOBAL_CTORS_BODY) && defined (HAS_INIT_SECTION)
static void ix86_svr3_asm_out_constructor PARAMS ((rtx, int));
@@ -897,6 +969,9 @@ static enum x86_64_reg_class merge_classes PARAMS ((enum x86_64_reg_class,
#define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD \
ia32_multipass_dfa_lookahead
+#undef TARGET_FUNCTION_OK_FOR_SIBCALL
+#define TARGET_FUNCTION_OK_FOR_SIBCALL ix86_function_ok_for_sibcall
+
#ifdef HAVE_AS_TLS
#undef TARGET_HAVE_TLS
#define TARGET_HAVE_TLS true
@@ -904,6 +979,9 @@ static enum x86_64_reg_class merge_classes PARAMS ((enum x86_64_reg_class,
#undef TARGET_CANNOT_FORCE_CONST_MEM
#define TARGET_CANNOT_FORCE_CONST_MEM ix86_cannot_force_const_mem
+#undef TARGET_MS_BITFIELD_LAYOUT_P
+#define TARGET_MS_BITFIELD_LAYOUT_P ix86_ms_bitfield_layout_p
+
#undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK x86_output_mi_thunk
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
@@ -937,17 +1015,17 @@ override_options ()
const int align_jump;
const int align_jump_max_skip;
const int align_func;
- const int branch_cost;
}
const processor_target_table[PROCESSOR_max] =
{
- {&i386_cost, 0, 0, 4, 3, 4, 3, 4, 1},
- {&i486_cost, 0, 0, 16, 15, 16, 15, 16, 1},
- {&pentium_cost, 0, 0, 16, 7, 16, 7, 16, 1},
- {&pentiumpro_cost, 0, 0, 16, 15, 16, 7, 16, 1},
- {&k6_cost, 0, 0, 32, 7, 32, 7, 32, 1},
- {&athlon_cost, 0, 0, 16, 7, 64, 7, 16, 1},
- {&pentium4_cost, 0, 0, 0, 0, 0, 0, 0, 1}
+ {&i386_cost, 0, 0, 4, 3, 4, 3, 4},
+ {&i486_cost, 0, 0, 16, 15, 16, 15, 16},
+ {&pentium_cost, 0, 0, 16, 7, 16, 7, 16},
+ {&pentiumpro_cost, 0, 0, 16, 15, 16, 7, 16},
+ {&k6_cost, 0, 0, 32, 7, 32, 7, 32},
+ {&athlon_cost, 0, 0, 16, 7, 16, 7, 16},
+ {&pentium4_cost, 0, 0, 0, 0, 0, 0, 0},
+ {&k8_cost, 0, 0, 16, 7, 16, 7, 16}
};
static const char * const cpu_names[] = TARGET_CPU_DEFAULT_NAMES;
@@ -962,7 +1040,8 @@ override_options ()
PTA_MMX = 4,
PTA_PREFETCH_SSE = 8,
PTA_3DNOW = 16,
- PTA_3DNOW_A = 64
+ PTA_3DNOW_A = 64,
+ PTA_64BIT = 128
} flags;
}
const processor_alias_table[] =
@@ -994,6 +1073,8 @@ override_options ()
| PTA_3DNOW_A | PTA_SSE},
{"athlon-mp", PROCESSOR_ATHLON, PTA_MMX | PTA_PREFETCH_SSE | PTA_3DNOW
| PTA_3DNOW_A | PTA_SSE},
+ {"k8", PROCESSOR_K8, PTA_MMX | PTA_PREFETCH_SSE | PTA_3DNOW | PTA_64BIT
+ | PTA_3DNOW_A | PTA_SSE | PTA_SSE2},
};
int const pta_size = ARRAY_SIZE (processor_alias_table);
@@ -1033,7 +1114,7 @@ override_options ()
if (!ix86_cpu_string)
ix86_cpu_string = cpu_names [TARGET_CPU_DEFAULT];
if (!ix86_arch_string)
- ix86_arch_string = TARGET_64BIT ? "athlon-4" : "i386";
+ ix86_arch_string = TARGET_64BIT ? "k8" : "i386";
if (ix86_cmodel_string != 0)
{
@@ -1099,6 +1180,8 @@ override_options ()
target_flags |= MASK_SSE2;
if (processor_alias_table[i].flags & PTA_PREFETCH_SSE)
x86_prefetch_sse = true;
+ if (TARGET_64BIT && !(processor_alias_table[i].flags & PTA_64BIT))
+ error ("CPU you selected does not support x86-64 instruction set");
break;
}
@@ -1109,6 +1192,8 @@ override_options ()
if (! strcmp (ix86_cpu_string, processor_alias_table[i].name))
{
ix86_cpu = processor_alias_table[i].processor;
+ if (TARGET_64BIT && !(processor_alias_table[i].flags & PTA_64BIT))
+ error ("CPU you selected does not support x86-64 instruction set");
break;
}
if (processor_alias_table[i].flags & PTA_PREFETCH_SSE)
@@ -1215,7 +1300,7 @@ override_options ()
}
/* Validate -mbranch-cost= value, or provide default. */
- ix86_branch_cost = processor_target_table[ix86_cpu].branch_cost;
+ ix86_branch_cost = processor_target_table[ix86_cpu].cost->branch_cost;
if (ix86_branch_cost_string)
{
i = atoi (ix86_branch_cost_string);
@@ -1371,6 +1456,60 @@ const struct attribute_spec ix86_attribute_table[] =
{ NULL, 0, 0, false, false, false, NULL }
};
+/* If PIC, we cannot make sibling calls to global functions
+ because the PLT requires %ebx live.
+ If we are returning floats on the register stack, we cannot make
+ sibling calls to functions that return floats. (The stack adjust
+ instruction will wind up after the sibcall jump, and not be executed.) */
+
+static bool
+ix86_function_ok_for_sibcall (decl, exp)
+ tree decl;
+ tree exp;
+{
+ /* If we are generating position-independent code, we cannot sibcall
+ optimize any indirect call, or a direct call to a global function,
+ as the PLT requires %ebx be live. */
+ if (!TARGET_64BIT && flag_pic && (!decl || TREE_PUBLIC (decl)))
+ return false;
+
+ /* If we are returning floats on the 80387 register stack, we cannot
+ make a sibcall from a function that doesn't return a float to a
+ function that does; the necessary stack adjustment will not be
+ executed. */
+ if (STACK_REG_P (ix86_function_value (TREE_TYPE (exp)))
+ && ! STACK_REG_P (ix86_function_value (TREE_TYPE (DECL_RESULT (cfun->decl)))))
+ return false;
+
+ /* If this call is indirect, we'll need to be able to use a call-clobbered
+ register for the address of the target function. Make sure that all
+ such registers are not used for passing parameters. */
+ if (!decl && !TARGET_64BIT)
+ {
+ int regparm = ix86_regparm;
+ tree attr, type;
+
+ /* We're looking at the CALL_EXPR, we need the type of the function. */
+ type = TREE_OPERAND (exp, 0); /* pointer expression */
+ type = TREE_TYPE (type); /* pointer type */
+ type = TREE_TYPE (type); /* function type */
+
+ attr = lookup_attribute ("regparm", TYPE_ATTRIBUTES (type));
+ if (attr)
+ regparm = TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (attr)));
+
+ if (regparm >= 3)
+ {
+ /* ??? Need to count the actual number of registers to be used,
+ not the possible number of registers. Fix later. */
+ return false;
+ }
+ }
+
+ /* Otherwise okay. That also includes certain types of indirect calls. */
+ return true;
+}
+
/* Handle a "cdecl" or "stdcall" attribute;
arguments as in struct attribute_spec.handler. */
static tree
@@ -3209,6 +3348,32 @@ call_insn_operand (op, mode)
return general_operand (op, Pmode);
}
+/* Test for a valid operand for a call instruction. Don't allow the
+ arg pointer register or virtual regs since they may decay into
+ reg + const, which the patterns can't handle. */
+
+int
+sibcall_insn_operand (op, mode)
+ rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ /* Disallow indirect through a virtual register. This leads to
+ compiler aborts when trying to eliminate them. */
+ if (GET_CODE (op) == REG
+ && (op == arg_pointer_rtx
+ || op == frame_pointer_rtx
+ || (REGNO (op) >= FIRST_PSEUDO_REGISTER
+ && REGNO (op) <= LAST_VIRTUAL_REGISTER)))
+ return 0;
+
+ /* Explicitly allow SYMBOL_REF even if pic. */
+ if (GET_CODE (op) == SYMBOL_REF)
+ return 1;
+
+ /* Otherwise we can only allow register operands. */
+ return register_operand (op, Pmode);
+}
+
int
constant_call_address_operand (op, mode)
rtx op;
@@ -3387,6 +3552,18 @@ q_regs_operand (op, mode)
return ANY_QI_REG_P (op);
}
+/* Return true if op is an flags register. */
+
+int
+flags_reg_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode;
+{
+ if (mode != VOIDmode && GET_MODE (op) != mode)
+ return 0;
+ return REG_P (op) && REGNO (op) == FLAGS_REG && GET_MODE (op) != VOIDmode;
+}
+
/* Return true if op is a NON_Q_REGS class register. */
int
@@ -3401,6 +3578,31 @@ non_q_regs_operand (op, mode)
return NON_QI_REG_P (op);
}
+int
+zero_extended_scalar_load_operand (op, mode)
+ rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ unsigned n_elts;
+ if (GET_CODE (op) != MEM)
+ return 0;
+ op = maybe_get_pool_constant (op);
+ if (!op)
+ return 0;
+ if (GET_CODE (op) != CONST_VECTOR)
+ return 0;
+ n_elts =
+ (GET_MODE_SIZE (GET_MODE (op)) /
+ GET_MODE_SIZE (GET_MODE_INNER (GET_MODE (op))));
+ for (n_elts--; n_elts > 0; n_elts--)
+ {
+ rtx elt = CONST_VECTOR_ELT (op, n_elts);
+ if (elt != CONST0_RTX (GET_MODE_INNER (GET_MODE (op))))
+ return 0;
+ }
+ return 1;
+}
+
/* Return 1 if OP is a comparison that can be used in the CMPSS/CMPPS
insns. */
int
@@ -4160,7 +4362,7 @@ output_set_got (dest)
is what will be referred to by the Mach-O PIC subsystem. */
ASM_OUTPUT_LABEL (asm_out_file, machopic_function_base_name ());
#endif
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (XEXP (xops[2], 0)));
if (flag_pic)
@@ -4456,14 +4658,32 @@ ix86_expand_prologue ()
int use_mov = 0;
HOST_WIDE_INT allocate;
+ ix86_compute_frame_layout (&frame);
if (!optimize_size)
{
- use_fast_prologue_epilogue
- = !expensive_function_p (FAST_PROLOGUE_INSN_COUNT);
+ int count = frame.nregs;
+
+ /* The fast prologue uses move instead of push to save registers. This
+ is significantly longer, but also executes faster as modern hardware
+ can execute the moves in parallel, but can't do that for push/pop.
+
+ Be curefull about choosing what prologue to emit: When function takes
+ many instructions to execute we may use slow version as well as in
+ case function is known to be outside hot spot (this is known with
+ feedback only). Weight the size of function by number of registers
+ to save as it is cheap to use one or two push instructions but very
+ slow to use many of them. */
+ if (count)
+ count = (count - 1) * FAST_PROLOGUE_INSN_COUNT;
+ if (cfun->function_frequency < FUNCTION_FREQUENCY_NORMAL
+ || (flag_branch_probabilities
+ && cfun->function_frequency < FUNCTION_FREQUENCY_HOT))
+ use_fast_prologue_epilogue = 0;
+ else
+ use_fast_prologue_epilogue = !expensive_function_p (count);
if (TARGET_PROLOGUE_USING_MOVE)
use_mov = use_fast_prologue_epilogue;
}
- ix86_compute_frame_layout (&frame);
/* Note: AT&T enter does NOT have reversed args. Enter is probably
slower on all targets. Also sdb doesn't like it. */
@@ -8960,6 +9180,84 @@ ix86_expand_setcc (code, dest)
return 1; /* DONE */
}
+/* Expand comparison setting or clearing carry flag. Return true when sucesfull
+ and set pop for the operation. */
+bool
+ix86_expand_carry_flag_compare (code, op0, op1, pop)
+ rtx op0, op1, *pop;
+ enum rtx_code code;
+{
+ enum machine_mode mode =
+ GET_MODE (op0) != VOIDmode ? GET_MODE (op0) : GET_MODE (op1);
+
+ /* Do not handle DImode compares that go trought special path. Also we can't
+ deal with FP compares yet. This is possible to add. */
+ if ((mode == DImode && !TARGET_64BIT) || !INTEGRAL_MODE_P (mode))
+ return false;
+ switch (code)
+ {
+ case LTU:
+ case GEU:
+ break;
+
+ /* Convert a==0 into (unsigned)a<1. */
+ case EQ:
+ case NE:
+ if (op1 != const0_rtx)
+ return false;
+ op1 = const1_rtx;
+ code = (code == EQ ? LTU : GEU);
+ break;
+
+ /* Convert a>b into b<a or a>=b-1. */
+ case GTU:
+ case LEU:
+ if (GET_CODE (op1) == CONST_INT)
+ {
+ op1 = gen_int_mode (INTVAL (op1) + 1, GET_MODE (op0));
+ /* Bail out on overflow. We still can swap operands but that
+ would force loading of the constant into register. */
+ if (op1 == const0_rtx
+ || !x86_64_immediate_operand (op1, GET_MODE (op1)))
+ return false;
+ code = (code == GTU ? GEU : LTU);
+ }
+ else
+ {
+ rtx tmp = op1;
+ op1 = op0;
+ op0 = tmp;
+ code = (code == GTU ? LTU : GEU);
+ }
+ break;
+
+ /* Convert a>0 into (unsigned)a<0x7fffffff. */
+ case LT:
+ case GE:
+ if (mode == DImode || op1 != const0_rtx)
+ return false;
+ op1 = gen_int_mode (~(1 << (GET_MODE_BITSIZE (mode) - 1)), mode);
+ code = (code == LT ? GEU : LTU);
+ break;
+ case LE:
+ case GT:
+ if (mode == DImode || op1 != constm1_rtx)
+ return false;
+ op1 = gen_int_mode (~(1 << (GET_MODE_BITSIZE (mode) - 1)), mode);
+ code = (code == LE ? GEU : LTU);
+ break;
+
+ default:
+ return false;
+ }
+ ix86_compare_op0 = op0;
+ ix86_compare_op1 = op1;
+ *pop = ix86_expand_compare (code, NULL, NULL);
+ if (GET_CODE (*pop) != LTU && GET_CODE (*pop) != GEU)
+ abort ();
+ return true;
+}
+
int
ix86_expand_int_movcc (operands)
rtx operands[];
@@ -8968,30 +9266,7 @@ ix86_expand_int_movcc (operands)
rtx compare_seq, compare_op;
rtx second_test, bypass_test;
enum machine_mode mode = GET_MODE (operands[0]);
-
- /* When the compare code is not LTU or GEU, we can not use sbbl case.
- In case comparsion is done with immediate, we can convert it to LTU or
- GEU by altering the integer. */
-
- if ((code == LEU || code == GTU)
- && GET_CODE (ix86_compare_op1) == CONST_INT
- && mode != HImode
- && INTVAL (ix86_compare_op1) != -1
- /* For x86-64, the immediate field in the instruction is 32-bit
- signed, so we can't increment a DImode value above 0x7fffffff. */
- && (!TARGET_64BIT
- || GET_MODE (ix86_compare_op0) != DImode
- || INTVAL (ix86_compare_op1) != 0x7fffffff)
- && GET_CODE (operands[2]) == CONST_INT
- && GET_CODE (operands[3]) == CONST_INT)
- {
- if (code == LEU)
- code = LTU;
- else
- code = GEU;
- ix86_compare_op1 = gen_int_mode (INTVAL (ix86_compare_op1) + 1,
- GET_MODE (ix86_compare_op0));
- }
+ bool sign_bit_compare_p = false;;
start_sequence ();
compare_op = ix86_expand_compare (code, &second_test, &bypass_test);
@@ -9000,10 +9275,14 @@ ix86_expand_int_movcc (operands)
compare_code = GET_CODE (compare_op);
+ if ((ix86_compare_op1 == const0_rtx && (code == GE || code == LT))
+ || (ix86_compare_op1 == constm1_rtx && (code == GT || code == LE)))
+ sign_bit_compare_p = true;
+
/* Don't attempt mode expansion here -- if we had to expand 5 or 6
HImode insns, we'd be swallowed in word prefix ops. */
- if (mode != HImode
+ if ((mode != HImode || TARGET_FAST_PREFIX)
&& (mode != DImode || TARGET_64BIT)
&& GET_CODE (operands[2]) == CONST_INT
&& GET_CODE (operands[3]) == CONST_INT)
@@ -9013,32 +9292,53 @@ ix86_expand_int_movcc (operands)
HOST_WIDE_INT cf = INTVAL (operands[3]);
HOST_WIDE_INT diff;
- if ((compare_code == LTU || compare_code == GEU)
- && !second_test && !bypass_test)
+ diff = ct - cf;
+ /* Sign bit compares are better done using shifts than we do by using
+ sbb. */
+ if (sign_bit_compare_p
+ || ix86_expand_carry_flag_compare (code, ix86_compare_op0,
+ ix86_compare_op1, &compare_op))
{
/* Detect overlap between destination and compare sources. */
rtx tmp = out;
- /* To simplify rest of code, restrict to the GEU case. */
- if (compare_code == LTU)
+ if (!sign_bit_compare_p)
{
- HOST_WIDE_INT tmp = ct;
- ct = cf;
- cf = tmp;
- compare_code = reverse_condition (compare_code);
- code = reverse_condition (code);
- }
- diff = ct - cf;
+ compare_code = GET_CODE (compare_op);
+
+ /* To simplify rest of code, restrict to the GEU case. */
+ if (compare_code == LTU)
+ {
+ HOST_WIDE_INT tmp = ct;
+ ct = cf;
+ cf = tmp;
+ compare_code = reverse_condition (compare_code);
+ code = reverse_condition (code);
+ }
+ diff = ct - cf;
- if (reg_overlap_mentioned_p (out, ix86_compare_op0)
- || reg_overlap_mentioned_p (out, ix86_compare_op1))
- tmp = gen_reg_rtx (mode);
+ if (reg_overlap_mentioned_p (out, ix86_compare_op0)
+ || reg_overlap_mentioned_p (out, ix86_compare_op1))
+ tmp = gen_reg_rtx (mode);
- emit_insn (compare_seq);
- if (mode == DImode)
- emit_insn (gen_x86_movdicc_0_m1_rex64 (tmp));
+ if (mode == DImode)
+ emit_insn (gen_x86_movdicc_0_m1_rex64 (tmp));
+ else
+ emit_insn (gen_x86_movsicc_0_m1 (gen_lowpart (SImode, tmp)));
+ }
else
- emit_insn (gen_x86_movsicc_0_m1 (tmp));
+ {
+ if (code == GT || code == GE)
+ code = reverse_condition (code);
+ else
+ {
+ HOST_WIDE_INT tmp = ct;
+ ct = cf;
+ cf = tmp;
+ }
+ tmp = emit_store_flag (tmp, code, ix86_compare_op0,
+ ix86_compare_op1, VOIDmode, 0, -1);
+ }
if (diff == 1)
{
@@ -9052,7 +9352,7 @@ ix86_expand_int_movcc (operands)
if (ct)
tmp = expand_simple_binop (mode, PLUS,
tmp, GEN_INT (ct),
- tmp, 1, OPTAB_DIRECT);
+ copy_rtx (tmp), 1, OPTAB_DIRECT);
}
else if (cf == -1)
{
@@ -9065,7 +9365,7 @@ ix86_expand_int_movcc (operands)
*/
tmp = expand_simple_binop (mode, IOR,
tmp, GEN_INT (ct),
- tmp, 1, OPTAB_DIRECT);
+ copy_rtx (tmp), 1, OPTAB_DIRECT);
}
else if (diff == -1 && ct)
{
@@ -9077,11 +9377,11 @@ ix86_expand_int_movcc (operands)
*
* Size 8 - 11.
*/
- tmp = expand_simple_unop (mode, NOT, tmp, tmp, 1);
+ tmp = expand_simple_unop (mode, NOT, tmp, copy_rtx (tmp), 1);
if (cf)
tmp = expand_simple_binop (mode, PLUS,
- tmp, GEN_INT (cf),
- tmp, 1, OPTAB_DIRECT);
+ copy_rtx (tmp), GEN_INT (cf),
+ copy_rtx (tmp), 1, OPTAB_DIRECT);
}
else
{
@@ -9099,26 +9399,25 @@ ix86_expand_int_movcc (operands)
{
cf = ct;
ct = 0;
- tmp = expand_simple_unop (mode, NOT, tmp, tmp, 1);
+ tmp = expand_simple_unop (mode, NOT, tmp, copy_rtx (tmp), 1);
}
tmp = expand_simple_binop (mode, AND,
- tmp,
+ copy_rtx (tmp),
gen_int_mode (cf - ct, mode),
- tmp, 1, OPTAB_DIRECT);
+ copy_rtx (tmp), 1, OPTAB_DIRECT);
if (ct)
tmp = expand_simple_binop (mode, PLUS,
- tmp, GEN_INT (ct),
- tmp, 1, OPTAB_DIRECT);
+ copy_rtx (tmp), GEN_INT (ct),
+ copy_rtx (tmp), 1, OPTAB_DIRECT);
}
- if (tmp != out)
- emit_move_insn (out, tmp);
+ if (!rtx_equal_p (tmp, out))
+ emit_move_insn (copy_rtx (out), copy_rtx (tmp));
return 1; /* DONE */
}
- diff = ct - cf;
if (diff < 0)
{
HOST_WIDE_INT tmp;
@@ -9194,8 +9493,10 @@ ix86_expand_int_movcc (operands)
}
}
+
if ((diff == 1 || diff == 2 || diff == 4 || diff == 8
|| diff == 3 || diff == 5 || diff == 9)
+ && ((mode != QImode && mode != HImode) || !TARGET_PARTIAL_REG_STALL)
&& (mode != DImode || x86_64_sign_extended_value (GEN_INT (cf))))
{
/*
@@ -9237,15 +9538,14 @@ ix86_expand_int_movcc (operands)
tmp = gen_rtx_PLUS (mode, tmp, GEN_INT (cf));
nops++;
}
- if (tmp != out
- && (GET_CODE (tmp) != SUBREG || SUBREG_REG (tmp) != out))
+ if (!rtx_equal_p (tmp, out))
{
if (nops == 1)
out = force_operand (tmp, out);
else
- emit_insn (gen_rtx_SET (VOIDmode, out, tmp));
+ emit_insn (gen_rtx_SET (VOIDmode, copy_rtx (out), copy_rtx (tmp)));
}
- if (out != operands[0])
+ if (!rtx_equal_p (out, operands[0]))
emit_move_insn (operands[0], copy_rtx (out));
return 1; /* DONE */
@@ -9265,12 +9565,10 @@ ix86_expand_int_movcc (operands)
* This is reasonably steep, but branch mispredict costs are
* high on modern cpus, so consider failing only if optimizing
* for space.
- *
- * %%% Parameterize branch_cost on the tuning architecture, then
- * use that. The 80386 couldn't care less about mispredicts.
*/
- if (!optimize_size && !TARGET_CMOVE)
+ if ((!TARGET_CMOVE || (mode == QImode && TARGET_PARTIAL_REG_STALL))
+ && BRANCH_COST >= 2)
{
if (cf == 0)
{
@@ -9324,31 +9622,31 @@ ix86_expand_int_movcc (operands)
out = emit_store_flag (out, code, ix86_compare_op0,
ix86_compare_op1, VOIDmode, 0, 1);
- out = expand_simple_binop (mode, PLUS, out, constm1_rtx,
- out, 1, OPTAB_DIRECT);
+ out = expand_simple_binop (mode, PLUS, copy_rtx (out), constm1_rtx,
+ copy_rtx (out), 1, OPTAB_DIRECT);
}
- out = expand_simple_binop (mode, AND, out,
+ out = expand_simple_binop (mode, AND, copy_rtx (out),
gen_int_mode (cf - ct, mode),
- out, 1, OPTAB_DIRECT);
+ copy_rtx (out), 1, OPTAB_DIRECT);
if (ct)
- out = expand_simple_binop (mode, PLUS, out, GEN_INT (ct),
- out, 1, OPTAB_DIRECT);
- if (out != operands[0])
- emit_move_insn (operands[0], out);
+ out = expand_simple_binop (mode, PLUS, copy_rtx (out), GEN_INT (ct),
+ copy_rtx (out), 1, OPTAB_DIRECT);
+ if (!rtx_equal_p (out, operands[0]))
+ emit_move_insn (operands[0], copy_rtx (out));
return 1; /* DONE */
}
}
- if (!TARGET_CMOVE)
+ if (!TARGET_CMOVE || (mode == QImode && TARGET_PARTIAL_REG_STALL))
{
/* Try a few things more with specific constants and a variable. */
optab op;
rtx var, orig_out, out, tmp;
- if (optimize_size)
+ if (BRANCH_COST <= 2)
return 0; /* FAIL */
/* If one of the two operands is an interesting constant, load a
@@ -9357,9 +9655,9 @@ ix86_expand_int_movcc (operands)
if (GET_CODE (operands[2]) == CONST_INT)
{
var = operands[3];
- if (INTVAL (operands[2]) == 0)
+ if (INTVAL (operands[2]) == 0 && operands[3] != constm1_rtx)
operands[3] = constm1_rtx, op = and_optab;
- else if (INTVAL (operands[2]) == -1)
+ else if (INTVAL (operands[2]) == -1 && operands[3] != const0_rtx)
operands[3] = const0_rtx, op = ior_optab;
else
return 0; /* FAIL */
@@ -9367,9 +9665,9 @@ ix86_expand_int_movcc (operands)
else if (GET_CODE (operands[3]) == CONST_INT)
{
var = operands[2];
- if (INTVAL (operands[3]) == 0)
+ if (INTVAL (operands[3]) == 0 && operands[2] != constm1_rtx)
operands[2] = constm1_rtx, op = and_optab;
- else if (INTVAL (operands[3]) == -1)
+ else if (INTVAL (operands[3]) == -1 && operands[3] != const0_rtx)
operands[2] = const0_rtx, op = ior_optab;
else
return 0; /* FAIL */
@@ -9388,8 +9686,8 @@ ix86_expand_int_movcc (operands)
/* Mask in the interesting variable. */
out = expand_binop (mode, op, var, tmp, orig_out, 0,
OPTAB_WIDEN);
- if (out != orig_out)
- emit_move_insn (orig_out, out);
+ if (!rtx_equal_p (out, orig_out))
+ emit_move_insn (copy_rtx (orig_out), copy_rtx (out));
return 1; /* DONE */
}
@@ -9422,27 +9720,33 @@ ix86_expand_int_movcc (operands)
emit_move_insn (tmp, operands[2]);
operands[2] = tmp;
}
+
if (! register_operand (operands[2], VOIDmode)
- && ! register_operand (operands[3], VOIDmode))
+ && (mode == QImode
+ || ! register_operand (operands[3], VOIDmode)))
operands[2] = force_reg (mode, operands[2]);
+ if (mode == QImode
+ && ! register_operand (operands[3], VOIDmode))
+ operands[3] = force_reg (mode, operands[3]);
+
emit_insn (compare_seq);
emit_insn (gen_rtx_SET (VOIDmode, operands[0],
gen_rtx_IF_THEN_ELSE (mode,
compare_op, operands[2],
operands[3])));
if (bypass_test)
- emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ emit_insn (gen_rtx_SET (VOIDmode, copy_rtx (operands[0]),
gen_rtx_IF_THEN_ELSE (mode,
bypass_test,
- operands[3],
- operands[0])));
+ copy_rtx (operands[3]),
+ copy_rtx (operands[0]))));
if (second_test)
- emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ emit_insn (gen_rtx_SET (VOIDmode, copy_rtx (operands[0]),
gen_rtx_IF_THEN_ELSE (mode,
second_test,
- operands[2],
- operands[0])));
+ copy_rtx (operands[2]),
+ copy_rtx (operands[0]))));
return 1; /* DONE */
}
@@ -9483,8 +9787,14 @@ ix86_expand_fp_movcc (operands)
if (rtx_equal_p (operands[2], op0) && rtx_equal_p (operands[3], op1))
{
/* Check for min operation. */
- if (code == LT)
+ if (code == LT || code == UNLE)
{
+ if (code == UNLE)
+ {
+ rtx tmp = op0;
+ op0 = op1;
+ op1 = tmp;
+ }
operands[0] = force_reg (GET_MODE (operands[0]), operands[0]);
if (memory_operand (op0, VOIDmode))
op0 = force_reg (GET_MODE (operands[0]), op0);
@@ -9495,8 +9805,14 @@ ix86_expand_fp_movcc (operands)
return 1;
}
/* Check for max operation. */
- if (code == GT)
+ if (code == GT || code == UNGE)
{
+ if (code == UNGE)
+ {
+ rtx tmp = op0;
+ op0 = op1;
+ op1 = tmp;
+ }
operands[0] = force_reg (GET_MODE (operands[0]), operands[0]);
if (memory_operand (op0, VOIDmode))
op0 = force_reg (GET_MODE (operands[0]), op0);
@@ -10242,8 +10558,12 @@ ix86_expand_movstr (dst, src, count_exp, align_exp)
/* In case we don't know anything about the alignment, default to
library version, since it is usually equally fast and result in
- shorter code. */
- if (!TARGET_INLINE_ALL_STRINGOPS && align < UNITS_PER_WORD)
+ shorter code.
+
+ Also emit call when we know that the count is large and call overhead
+ will not be important. */
+ if (!TARGET_INLINE_ALL_STRINGOPS
+ && (align < UNITS_PER_WORD || !TARGET_REP_MOVL_OPTIMAL))
{
end_sequence ();
return 0;
@@ -10457,8 +10777,12 @@ ix86_expand_clrstr (src, count_exp, align_exp)
/* In case we don't know anything about the alignment, default to
library version, since it is usually equally fast and result in
- shorter code. */
- if (!TARGET_INLINE_ALL_STRINGOPS && align < UNITS_PER_WORD)
+ shorter code.
+
+ Also emit call when we know that the count is large and call overhead
+ will not be important. */
+ if (!TARGET_INLINE_ALL_STRINGOPS
+ && (align < UNITS_PER_WORD || !TARGET_REP_MOVL_OPTIMAL))
return 0;
if (TARGET_SINGLE_STRINGOP)
@@ -10828,8 +11152,9 @@ ix86_expand_strlensi_unroll_1 (out, align_rtx)
}
void
-ix86_expand_call (retval, fnaddr, callarg1, callarg2, pop)
+ix86_expand_call (retval, fnaddr, callarg1, callarg2, pop, sibcall)
rtx retval, fnaddr, callarg1, callarg2, pop;
+ int sibcall;
{
rtx use = NULL, call;
@@ -10861,6 +11186,15 @@ ix86_expand_call (retval, fnaddr, callarg1, callarg2, pop)
fnaddr = copy_to_mode_reg (Pmode, XEXP (fnaddr, 0));
fnaddr = gen_rtx_MEM (QImode, fnaddr);
}
+ if (sibcall && TARGET_64BIT
+ && !constant_call_address_operand (XEXP (fnaddr, 0), Pmode))
+ {
+ rtx addr;
+ addr = copy_to_mode_reg (Pmode, XEXP (fnaddr, 0));
+ fnaddr = gen_rtx_REG (Pmode, 40);
+ emit_move_insn (fnaddr, addr);
+ fnaddr = gen_rtx_MEM (QImode, fnaddr);
+ }
call = gen_rtx_CALL (VOIDmode, fnaddr, callarg1);
if (retval)
@@ -11060,6 +11394,7 @@ ix86_issue_rate ()
case PROCESSOR_PENTIUMPRO:
case PROCESSOR_PENTIUM4:
case PROCESSOR_ATHLON:
+ case PROCESSOR_K8:
return 3;
default:
@@ -11271,16 +11606,10 @@ ix86_adjust_cost (insn, link, dep_insn, cost)
break;
case PROCESSOR_ATHLON:
+ case PROCESSOR_K8:
memory = get_attr_memory (insn);
dep_memory = get_attr_memory (dep_insn);
- if (dep_memory == MEMORY_LOAD || dep_memory == MEMORY_BOTH)
- {
- if (dep_insn_type == TYPE_IMOV || dep_insn_type == TYPE_FMOV)
- cost += 2;
- else
- cost += 3;
- }
/* Show ability of reorder buffer to hide latency of load by executing
in parallel with previous instruction in case
previous instruction is not needed to compute the address. */
@@ -11554,7 +11883,7 @@ ix86_variable_issue (dump, sched_verbose, insn, can_issue_more)
static int
ia32_use_dfa_pipeline_interface ()
{
- if (ix86_cpu == PROCESSOR_PENTIUM)
+ if (TARGET_PENTIUM || TARGET_ATHLON_K8)
return 1;
return 0;
}
@@ -12764,7 +13093,8 @@ safe_vector_operand (x, mode)
: gen_rtx_SUBREG (DImode, x, 0)));
else
emit_insn (gen_sse_clrv4sf (mode == V4SFmode ? x
- : gen_rtx_SUBREG (V4SFmode, x, 0)));
+ : gen_rtx_SUBREG (V4SFmode, x, 0),
+ CONST0_RTX (V4SFmode)));
return x;
}
@@ -13434,7 +13764,7 @@ ix86_expand_builtin (exp, target, subtarget, mode, ignore)
case IX86_BUILTIN_SSE_ZERO:
target = gen_reg_rtx (V4SFmode);
- emit_insn (gen_sse_clrv4sf (target));
+ emit_insn (gen_sse_clrv4sf (target, CONST0_RTX (V4SFmode)));
return target;
case IX86_BUILTIN_MMX_ZERO:
@@ -14058,6 +14388,17 @@ x86_order_regs_for_local_alloc ()
reg_alloc_order [pos++] = 0;
}
+#ifndef TARGET_USE_MS_BITFIELD_LAYOUT
+#define TARGET_USE_MS_BITFIELD_LAYOUT 0
+#endif
+
+static bool
+ix86_ms_bitfield_layout_p (record_type)
+ tree record_type ATTRIBUTE_UNUSED;
+{
+ return TARGET_USE_MS_BITFIELD_LAYOUT;
+}
+
/* Returns an expression indicating where the this parameter is
located on entry to the FUNCTION. */
@@ -14317,7 +14658,7 @@ x86_machine_dependent_reorg (first)
{
edge e;
- if (!TARGET_ATHLON || !optimize || optimize_size)
+ if (!TARGET_ATHLON_K8 || !optimize || optimize_size)
return;
for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next)
{
@@ -14328,25 +14669,69 @@ x86_machine_dependent_reorg (first)
if (!returnjump_p (ret) || !maybe_hot_bb_p (bb))
continue;
- prev = prev_nonnote_insn (ret);
+ for (prev = PREV_INSN (ret); prev; prev = PREV_INSN (prev))
+ if (active_insn_p (prev) || GET_CODE (prev) == CODE_LABEL)
+ break;
if (prev && GET_CODE (prev) == CODE_LABEL)
{
edge e;
for (e = bb->pred; e; e = e->pred_next)
- if (EDGE_FREQUENCY (e) && e->src->index > 0
+ if (EDGE_FREQUENCY (e) && e->src->index >= 0
&& !(e->flags & EDGE_FALLTHRU))
insert = 1;
}
if (!insert)
{
- prev = prev_real_insn (ret);
+ prev = prev_active_insn (ret);
if (prev && GET_CODE (prev) == JUMP_INSN
&& any_condjump_p (prev))
insert = 1;
+ /* Empty functions get branch misspredict even when the jump destination
+ is not visible to us. */
+ if (!prev && cfun->function_frequency > FUNCTION_FREQUENCY_UNLIKELY_EXECUTED)
+ insert = 1;
}
if (insert)
emit_insn_before (gen_nop (), ret);
}
}
+/* Return nonzero when QImode register that must be represented via REX prefix
+ is used. */
+bool
+x86_extended_QIreg_mentioned_p (insn)
+ rtx insn;
+{
+ int i;
+ extract_insn_cached (insn);
+ for (i = 0; i < recog_data.n_operands; i++)
+ if (REG_P (recog_data.operand[i])
+ && REGNO (recog_data.operand[i]) >= 4)
+ return true;
+ return false;
+}
+
+/* Return nonzero when P points to register encoded via REX prefix.
+ Called via for_each_rtx. */
+static int
+extended_reg_mentioned_1 (p, data)
+ rtx *p;
+ void *data ATTRIBUTE_UNUSED;
+{
+ unsigned int regno;
+ if (!REG_P (*p))
+ return 0;
+ regno = REGNO (*p);
+ return REX_INT_REGNO_P (regno) || REX_SSE_REGNO_P (regno);
+}
+
+/* Return true when INSN mentions register that must be encoded using REX
+ prefix. */
+bool
+x86_extended_reg_mentioned_p (insn)
+ rtx insn;
+{
+ return for_each_rtx (&PATTERN (insn), extended_reg_mentioned_1, NULL);
+}
+
#include "gt-i386.h"
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 493a2b5bf9c..c1f40dc209c 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -41,9 +41,11 @@ struct processor_costs {
const int lea; /* cost of a lea instruction */
const int shift_var; /* variable shift costs */
const int shift_const; /* constant shift costs */
- const int mult_init; /* cost of starting a multiply */
+ const int mult_init[5]; /* cost of starting a multiply
+ in QImode, HImode, SImode, DImode, TImode*/
const int mult_bit; /* cost of multiply per each bit set */
- const int divide; /* cost of a divide/mod */
+ const int divide[5]; /* cost of a divide/mod
+ in QImode, HImode, SImode, DImode, TImode*/
int movsx; /* The cost of movsx operation. */
int movzx; /* The cost of movzx operation. */
const int large_insn; /* insns larger than this cost more */
@@ -75,6 +77,7 @@ struct processor_costs {
const int prefetch_block; /* bytes moved to cache for prefetch. */
const int simultaneous_prefetches; /* number of parallel prefetch
operations. */
+ const int branch_cost; /* Default value for BRANCH_COST. */
const int fadd; /* cost of FADD and FSUB instructions. */
const int fmul; /* cost of FMUL instruction. */
const int fdiv; /* cost of FDIV instruction. */
@@ -118,8 +121,9 @@ extern int target_flags;
#define MASK_3DNOW_A 0x00020000 /* Support Athlon 3Dnow builtins */
#define MASK_128BIT_LONG_DOUBLE 0x00040000 /* long double size is 128bit */
#define MASK_64BIT 0x00080000 /* Produce 64bit code */
+#define MASK_MS_BITFIELD_LAYOUT 0x00100000 /* Use native (MS) bitfield layout */
-/* Unused: 0x03f0000 */
+/* Unused: 0x03e0000 */
/* ... overlap with subtarget options starts by 0x04000000. */
#define MASK_NO_RED_ZONE 0x04000000 /* Do not use red zone */
@@ -204,6 +208,8 @@ extern int target_flags;
#define TARGET_K6 (ix86_cpu == PROCESSOR_K6)
#define TARGET_ATHLON (ix86_cpu == PROCESSOR_ATHLON)
#define TARGET_PENTIUM4 (ix86_cpu == PROCESSOR_PENTIUM4)
+#define TARGET_K8 (ix86_cpu == PROCESSOR_K8)
+#define TARGET_ATHLON_K8 (TARGET_K8 || TARGET_ATHLON)
#define CPUMASK (1 << ix86_cpu)
extern const int x86_use_leave, x86_push_memory, x86_zero_extend_with_and;
@@ -221,6 +227,9 @@ extern const int x86_partial_reg_dependency, x86_memory_mismatch_stall;
extern const int x86_accumulate_outgoing_args, x86_prologue_using_move;
extern const int x86_epilogue_using_move, x86_decompose_lea;
extern const int x86_arch_always_fancy_math_387, x86_shift1;
+extern const int x86_sse_partial_reg_dependency, x86_sse_partial_regs;
+extern const int x86_sse_typeless_stores, x86_sse_load0_by_pxor;
+extern const int x86_use_ffreep, x86_sse_partial_regs_for_cvtsd2ss;
extern int x86_prefetch_sse;
#define TARGET_USE_LEAVE (x86_use_leave & CPUMASK)
@@ -257,12 +266,22 @@ extern int x86_prefetch_sse;
#define TARGET_SUB_ESP_8 (x86_sub_esp_8 & CPUMASK)
#define TARGET_INTEGER_DFMODE_MOVES (x86_integer_DFmode_moves & CPUMASK)
#define TARGET_PARTIAL_REG_DEPENDENCY (x86_partial_reg_dependency & CPUMASK)
+#define TARGET_SSE_PARTIAL_REG_DEPENDENCY \
+ (x86_sse_partial_reg_dependency & CPUMASK)
+#define TARGET_SSE_PARTIAL_REGS (x86_sse_partial_regs & CPUMASK)
+#define TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS \
+ (x86_sse_partial_regs_for_cvtsd2ss & CPUMASK)
+#define TARGET_SSE_TYPELESS_STORES (x86_sse_typeless_stores & CPUMASK)
+#define TARGET_SSE_TYPELESS_LOAD0 (x86_sse_typeless_load0 & CPUMASK)
+#define TARGET_SSE_LOAD0_BY_PXOR (x86_sse_load0_by_pxor & CPUMASK)
#define TARGET_MEMORY_MISMATCH_STALL (x86_memory_mismatch_stall & CPUMASK)
#define TARGET_PROLOGUE_USING_MOVE (x86_prologue_using_move & CPUMASK)
#define TARGET_EPILOGUE_USING_MOVE (x86_epilogue_using_move & CPUMASK)
#define TARGET_DECOMPOSE_LEA (x86_decompose_lea & CPUMASK)
#define TARGET_PREFETCH_SSE (x86_prefetch_sse)
#define TARGET_SHIFT1 (x86_shift1 & CPUMASK)
+#define TARGET_USE_FFREEP (x86_use_ffreep & CPUMASK)
+#define TARGET_REP_MOVL_OPTIMAL (x86_rep_movl_optimal & CPUMASK)
#define TARGET_STACK_PROBE (target_flags & MASK_STACK_PROBE)
@@ -282,6 +301,8 @@ extern int x86_prefetch_sse;
#define TARGET_RED_ZONE (!(target_flags & MASK_NO_RED_ZONE))
+#define TARGET_USE_MS_BITFIELD_LAYOUT (target_flags & MASK_MS_BITFIELD_LAYOUT)
+
#define TARGET_GNU_TLS (ix86_tls_dialect == TLS_DIALECT_GNU)
#define TARGET_SUN_TLS (ix86_tls_dialect == TLS_DIALECT_SUN)
@@ -374,6 +395,10 @@ extern int x86_prefetch_sse;
N_("Generate 64bit x86-64 code") }, \
{ "32", -MASK_64BIT, \
N_("Generate 32bit i386 code") }, \
+ { "ms-bitfields", MASK_MS_BITFIELD_LAYOUT, \
+ N_("Use native (MS) bitfield layout") }, \
+ { "no-ms-bitfields", -MASK_MS_BITFIELD_LAYOUT, \
+ N_("Use gcc default bitfield layout") }, \
{ "red-zone", -MASK_NO_RED_ZONE, \
N_("Use red-zone in the x86-64 code") }, \
{ "no-red-zone", MASK_NO_RED_ZONE, \
@@ -540,6 +565,8 @@ extern int x86_prefetch_sse;
if (last_cpu_char != 'n') \
builtin_define ("__tune_athlon_sse__"); \
} \
+ else if (TARGET_K8) \
+ builtin_define ("__tune_k8__"); \
else if (TARGET_PENTIUM4) \
builtin_define ("__tune_pentium4__"); \
\
@@ -598,6 +625,11 @@ extern int x86_prefetch_sse;
if (last_arch_char != 'n') \
builtin_define ("__athlon_sse__"); \
} \
+ else if (ix86_arch == PROCESSOR_K8) \
+ { \
+ builtin_define ("__k8"); \
+ builtin_define ("__k8__"); \
+ } \
else if (ix86_arch == PROCESSOR_PENTIUM4) \
{ \
builtin_define ("__pentium4"); \
@@ -619,11 +651,12 @@ extern int x86_prefetch_sse;
#define TARGET_CPU_DEFAULT_k6_3 10
#define TARGET_CPU_DEFAULT_athlon 11
#define TARGET_CPU_DEFAULT_athlon_sse 12
+#define TARGET_CPU_DEFAULT_k8 13
#define TARGET_CPU_DEFAULT_NAMES {"i386", "i486", "pentium", "pentium-mmx",\
"pentiumpro", "pentium2", "pentium3", \
"pentium4", "k6", "k6-2", "k6-3",\
- "athlon", "athlon-4"}
+ "athlon", "athlon-4", "k8"}
#ifndef CC1_SPEC
#define CC1_SPEC "%(cc1_cpu) "
@@ -1335,6 +1368,9 @@ enum reg_class
(((N) >= FIRST_SSE_REG && (N) <= LAST_SSE_REG) \
|| ((N) >= FIRST_REX_SSE_REG && (N) <= LAST_REX_SSE_REG))
+#define REX_SSE_REGNO_P(N) \
+ ((N) >= FIRST_REX_SSE_REG && (N) <= LAST_REX_SSE_REG)
+
#define SSE_REGNO(N) \
((N) < 8 ? FIRST_SSE_REG + (N) : FIRST_REX_SSE_REG + (N) - 8)
#define SSE_REG_P(N) (REG_P (N) && SSE_REGNO_P (REGNO (N)))
@@ -1716,18 +1752,6 @@ typedef struct ix86_args {
#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
-/* If PIC, we cannot make sibling calls to global functions
- because the PLT requires %ebx live.
- If we are returning floats on the register stack, we cannot make
- sibling calls to functions that return floats. (The stack adjust
- instruction will wind up after the sibcall jump, and not be executed.) */
-#define FUNCTION_OK_FOR_SIBCALL(DECL) \
- ((DECL) \
- && (! flag_pic || ! TREE_PUBLIC (DECL)) \
- && (! TARGET_FLOAT_RETURNS_IN_80387 \
- || ! FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (TREE_TYPE (DECL)))) \
- || FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (TREE_TYPE (cfun->decl))))))
-
/* Perform any needed actions needed for a function that is receiving a
variable number of arguments.
@@ -1839,12 +1863,6 @@ typedef struct ix86_args {
/* Addressing modes, and classification of registers for them. */
-/* #define HAVE_POST_INCREMENT 0 */
-/* #define HAVE_POST_DECREMENT 0 */
-
-/* #define HAVE_PRE_DECREMENT 0 */
-/* #define HAVE_PRE_INCREMENT 0 */
-
/* Macros to check register numbers against specific register classes. */
/* These assume that REGNO is a hard or pseudo reg number.
@@ -2602,6 +2620,14 @@ do { \
#define TOPLEVEL_COSTS_N_INSNS(N) \
do { total = COSTS_N_INSNS (N); goto egress_rtx_costs; } while (0)
+/* Return index of given mode in mult and division cost tables. */
+#define MODE_INDEX(mode) \
+ ((mode) == QImode ? 0 \
+ : (mode) == HImode ? 1 \
+ : (mode) == SImode ? 2 \
+ : (mode) == DImode ? 3 \
+ : 4)
+
/* Like `CONST_COSTS' but applies to nonconstant RTL expressions.
This can be used, for example, to indicate how costly a multiply
instruction is. In writing this macro, you can use the construct
@@ -2687,10 +2713,12 @@ do { \
} \
\
TOPLEVEL_COSTS_N_INSNS (ix86_cost->mult_init \
+ [MODE_INDEX (GET_MODE (X))] \
+ nbits * ix86_cost->mult_bit); \
} \
else /* This is arbitrary */ \
TOPLEVEL_COSTS_N_INSNS (ix86_cost->mult_init \
+ [MODE_INDEX (GET_MODE (X))] \
+ 7 * ix86_cost->mult_bit); \
\
case DIV: \
@@ -2700,7 +2728,8 @@ do { \
if (FLOAT_MODE_P (GET_MODE (X))) \
TOPLEVEL_COSTS_N_INSNS (ix86_cost->fdiv); \
else \
- TOPLEVEL_COSTS_N_INSNS (ix86_cost->divide); \
+ TOPLEVEL_COSTS_N_INSNS (ix86_cost->divide \
+ [MODE_INDEX (GET_MODE (X))]); \
break; \
\
case PLUS: \
@@ -3040,14 +3069,6 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4\
: DW_EH_PE_absptr)
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
/* This is how to output an insn to push a register on the stack.
It need not be very fast code. */
@@ -3241,6 +3262,7 @@ do { \
LABEL_REF, SUBREG, REG, MEM}}, \
{"pic_symbolic_operand", {CONST}}, \
{"call_insn_operand", {REG, SUBREG, MEM, SYMBOL_REF}}, \
+ {"sibcall_insn_operand", {REG, SUBREG, SYMBOL_REF}}, \
{"constant_call_address_operand", {SYMBOL_REF, CONST}}, \
{"const0_operand", {CONST_INT, CONST_DOUBLE}}, \
{"const1_operand", {CONST_INT}}, \
@@ -3252,6 +3274,7 @@ do { \
SYMBOL_REF, LABEL_REF, SUBREG, REG, MEM}}, \
{"nonmemory_no_elim_operand", {CONST_INT, REG, SUBREG}}, \
{"index_register_operand", {SUBREG, REG}}, \
+ {"flags_reg_operand", {REG}}, \
{"q_regs_operand", {SUBREG, REG}}, \
{"non_q_regs_operand", {SUBREG, REG}}, \
{"fcmov_comparison_operator", {EQ, NE, LTU, GTU, LEU, GEU, UNORDERED, \
@@ -3286,6 +3309,7 @@ do { \
{"register_and_not_any_fp_reg_operand", {REG}}, \
{"fp_register_operand", {REG}}, \
{"register_and_not_fp_reg_operand", {REG}}, \
+ {"zero_extended_scalar_load_operand", {MEM}}, \
/* A list of predicates that do special things with modes, and so
should not elicit warnings for VOIDmode match_operand. */
@@ -3305,6 +3329,7 @@ enum processor_type
PROCESSOR_K6,
PROCESSOR_ATHLON,
PROCESSOR_PENTIUM4,
+ PROCESSOR_K8,
PROCESSOR_max
};
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index befbfe49569..d625f586d46 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -132,7 +132,7 @@
;; Processor type. This attribute must exactly match the processor_type
;; enumeration in i386.h.
-(define_attr "cpu" "i386,i486,pentium,pentiumpro,k6,athlon,pentium4"
+(define_attr "cpu" "i386,i486,pentium,pentiumpro,k6,athlon,pentium4,k8"
(const (symbol_ref "ix86_cpu")))
;; A basic instruction type. Refinements due to arguments to be
@@ -142,7 +142,7 @@
alu,alu1,negnot,imov,imovx,lea,
incdec,ishift,ishift1,rotate,rotate1,imul,idiv,
icmp,test,ibr,setcc,icmov,
- push,pop,call,callv,
+ push,pop,call,callv,leave,
str,cld,
fmov,fop,fsgn,fmul,fdiv,fpspc,fcmov,fcmp,fxch,fistp,
sselog,sseiadd,sseishft,sseimul,
@@ -152,7 +152,7 @@
;; Main data type used by the insn
(define_attr "mode"
- "unknown,none,QI,HI,SI,DI,unknownfp,SF,DF,XF,TI,V4SF,V2DF,V2SF"
+ "unknown,none,QI,HI,SI,DI,SF,DF,XF,TI,V4SF,V2DF,V2SF"
(const_string "unknown"))
;; The CPU unit operations uses.
@@ -170,7 +170,7 @@
;; The (bounding maximum) length of an instruction immediate.
(define_attr "length_immediate" ""
- (cond [(eq_attr "type" "incdec,setcc,icmov,str,cld,lea,other,multi,idiv")
+ (cond [(eq_attr "type" "incdec,setcc,icmov,str,cld,lea,other,multi,idiv,leave")
(const_int 0)
(eq_attr "unit" "i387,sse,mmx")
(const_int 0)
@@ -232,9 +232,24 @@
(const_int 1)
(const_int 0)))
+;; Set when 0f opcode prefix is used.
+(define_attr "prefix_rex" ""
+ (cond [(and (eq_attr "mode" "DI")
+ (eq_attr "type" "!push,pop,call,callv,leave,ibr"))
+ (const_int 1)
+ (and (eq_attr "mode" "QI")
+ (ne (symbol_ref "x86_extended_QIreg_mentioned_p (insn)")
+ (const_int 0)))
+ (const_int 1)
+ (ne (symbol_ref "x86_extended_reg_mentioned_p (insn)")
+ (const_int 0))
+ (const_int 1)
+ ]
+ (const_int 0)))
+
;; Set when modrm byte is used.
(define_attr "modrm" ""
- (cond [(eq_attr "type" "str,cld")
+ (cond [(eq_attr "type" "str,cld,leave")
(const_int 0)
(eq_attr "unit" "i387")
(const_int 0)
@@ -273,7 +288,8 @@
(attr "length_address")))]
(plus (plus (attr "modrm")
(plus (attr "prefix_0f")
- (const_int 1)))
+ (plus (attr "prefix_rex")
+ (const_int 1))))
(plus (attr "prefix_rep")
(plus (attr "prefix_data16")
(plus (attr "length_immediate")
@@ -288,7 +304,7 @@
(const_string "unknown")
(eq_attr "type" "lea,fcmov,fpspc,cld")
(const_string "none")
- (eq_attr "type" "fistp")
+ (eq_attr "type" "fistp,leave")
(const_string "both")
(eq_attr "type" "push")
(if_then_else (match_operand 1 "memory_operand" "")
@@ -754,7 +770,13 @@
return "ftst\;fnstsw\t%0";
}
[(set_attr "type" "multi")
- (set_attr "mode" "unknownfp")])
+ (set (attr "mode")
+ (cond [(match_operand:SF 1 "" "")
+ (const_string "SF")
+ (match_operand:DF 1 "" "")
+ (const_string "DF")
+ ]
+ (const_string "XF")))])
;; We may not use "#" to split and emit these, since the REG_DEAD notes
;; used to manage the reg stack popping would not be preserved.
@@ -857,7 +879,13 @@
&& GET_MODE (operands[0]) == GET_MODE (operands[1])"
"* return output_fp_compare (insn, operands, 0, 1);"
[(set_attr "type" "fcmp")
- (set_attr "mode" "unknownfp")])
+ (set (attr "mode")
+ (cond [(match_operand:SF 1 "" "")
+ (const_string "SF")
+ (match_operand:DF 1 "" "")
+ (const_string "DF")
+ ]
+ (const_string "XF")))])
(define_insn "*cmpfp_2u_1"
[(set (match_operand:HI 0 "register_operand" "=a")
@@ -871,7 +899,13 @@
&& GET_MODE (operands[1]) == GET_MODE (operands[2])"
"* return output_fp_compare (insn, operands, 2, 1);"
[(set_attr "type" "multi")
- (set_attr "mode" "unknownfp")])
+ (set (attr "mode")
+ (cond [(match_operand:SF 1 "" "")
+ (const_string "SF")
+ (match_operand:DF 1 "" "")
+ (const_string "DF")
+ ]
+ (const_string "XF")))])
;; Patterns to match the SImode-in-memory ficom instructions.
;;
@@ -911,7 +945,7 @@
;; FP compares, step 2
;; Move the fpsw to ax.
-(define_insn "x86_fnstsw_1"
+(define_insn "*x86_fnstsw_1"
[(set (match_operand:HI 0 "register_operand" "=a")
(unspec:HI [(reg 18)] UNSPEC_FNSTSW))]
"TARGET_80387"
@@ -946,7 +980,13 @@
&& GET_MODE (operands[0]) == GET_MODE (operands[0])"
"* return output_fp_compare (insn, operands, 1, 0);"
[(set_attr "type" "fcmp")
- (set_attr "mode" "unknownfp")
+ (set (attr "mode")
+ (cond [(match_operand:SF 1 "" "")
+ (const_string "SF")
+ (match_operand:DF 1 "" "")
+ (const_string "DF")
+ ]
+ (const_string "XF")))
(set_attr "athlon_decode" "vector")])
(define_insn "*cmpfp_i_sse"
@@ -958,7 +998,10 @@
&& GET_MODE (operands[0]) == GET_MODE (operands[0])"
"* return output_fp_compare (insn, operands, 1, 0);"
[(set_attr "type" "fcmp,ssecmp")
- (set_attr "mode" "unknownfp")
+ (set (attr "mode")
+ (if_then_else (match_operand:SF 1 "" "")
+ (const_string "SF")
+ (const_string "DF")))
(set_attr "athlon_decode" "vector")])
(define_insn "*cmpfp_i_sse_only"
@@ -969,7 +1012,10 @@
&& GET_MODE (operands[0]) == GET_MODE (operands[0])"
"* return output_fp_compare (insn, operands, 1, 0);"
[(set_attr "type" "ssecmp")
- (set_attr "mode" "unknownfp")
+ (set (attr "mode")
+ (if_then_else (match_operand:SF 1 "" "")
+ (const_string "SF")
+ (const_string "DF")))
(set_attr "athlon_decode" "vector")])
(define_insn "*cmpfp_iu"
@@ -982,7 +1028,13 @@
&& GET_MODE (operands[0]) == GET_MODE (operands[1])"
"* return output_fp_compare (insn, operands, 1, 1);"
[(set_attr "type" "fcmp")
- (set_attr "mode" "unknownfp")
+ (set (attr "mode")
+ (cond [(match_operand:SF 1 "" "")
+ (const_string "SF")
+ (match_operand:DF 1 "" "")
+ (const_string "DF")
+ ]
+ (const_string "XF")))
(set_attr "athlon_decode" "vector")])
(define_insn "*cmpfp_iu_sse"
@@ -994,7 +1046,10 @@
&& GET_MODE (operands[0]) == GET_MODE (operands[1])"
"* return output_fp_compare (insn, operands, 1, 1);"
[(set_attr "type" "fcmp,ssecmp")
- (set_attr "mode" "unknownfp")
+ (set (attr "mode")
+ (if_then_else (match_operand:SF 1 "" "")
+ (const_string "SF")
+ (const_string "DF")))
(set_attr "athlon_decode" "vector")])
(define_insn "*cmpfp_iu_sse_only"
@@ -1005,7 +1060,10 @@
&& GET_MODE (operands[0]) == GET_MODE (operands[1])"
"* return output_fp_compare (insn, operands, 1, 1);"
[(set_attr "type" "ssecmp")
- (set_attr "mode" "unknownfp")
+ (set (attr "mode")
+ (if_then_else (match_operand:SF 1 "" "")
+ (const_string "SF")
+ (const_string "DF")))
(set_attr "athlon_decode" "vector")])
;; Move instructions.
@@ -2011,22 +2069,11 @@
{
switch (which_alternative)
{
- case 0:
- /* %%% We loose REG_DEAD notes for controling pops if we split late. */
- operands[0] = gen_rtx_MEM (SFmode, stack_pointer_rtx);
- operands[2] = stack_pointer_rtx;
- operands[3] = GEN_INT (4);
- if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "sub{l}\t{%3, %2|%2, %3}\;fstp%z0\t%y0";
- else
- return "sub{l}\t{%3, %2|%2, %3}\;fst%z0\t%y0";
-
case 1:
return "push{l}\t%1";
- case 2:
- return "#";
default:
+ /* This insn should be already splitted before reg-stack. */
abort ();
}
}
@@ -2040,23 +2087,11 @@
{
switch (which_alternative)
{
- case 0:
- /* %%% We loose REG_DEAD notes for controling pops if we split late. */
- operands[0] = gen_rtx_MEM (SFmode, stack_pointer_rtx);
- operands[2] = stack_pointer_rtx;
- operands[3] = GEN_INT (8);
- if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "sub{q}\t{%3, %2|%2, %3}\;fstp%z0\t%y0";
- else
- return "sub{q}\t{%3, %2|%2, %3}\;fst%z0\t%y0";
-
case 1:
return "push{q}\t%q1";
- case 2:
- return "#";
-
default:
+ /* This insn should be already splitted before reg-stack. */
abort ();
}
}
@@ -2104,7 +2139,12 @@
case 0:
if (REG_P (operands[1])
&& find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp\t%y0";
+ {
+ 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
@@ -2130,12 +2170,12 @@
case 4:
return "mov{l}\t{%1, %0|%0, %1}";
case 5:
- if (TARGET_SSE2 && !TARGET_ATHLON)
+ if (get_attr_mode (insn) == MODE_TI)
return "pxor\t%0, %0";
else
return "xorps\t%0, %0";
case 6:
- if (TARGET_PARTIAL_REG_DEPENDENCY)
+ if (get_attr_mode (insn) == MODE_V4SF)
return "movaps\t{%1, %0|%0, %1}";
else
return "movss\t{%1, %0|%0, %1}";
@@ -2155,7 +2195,40 @@
}
}
[(set_attr "type" "fmov,fmov,fmov,imov,imov,ssemov,ssemov,ssemov,ssemov,mmxmov,mmxmov,mmxmov")
- (set_attr "mode" "SF,SF,SF,SI,SI,TI,SF,SF,SF,SI,SI,DI")])
+ (set (attr "mode")
+ (cond [(eq_attr "alternative" "3,4,9,10")
+ (const_string "SI")
+ (eq_attr "alternative" "5")
+ (if_then_else
+ (and (and (ne (symbol_ref "TARGET_SSE_LOAD0_BY_PXOR")
+ (const_int 0))
+ (ne (symbol_ref "TARGET_SSE2")
+ (const_int 0)))
+ (eq (symbol_ref "optimize_size")
+ (const_int 0)))
+ (const_string "TI")
+ (const_string "V4SF"))
+ /* For architectures resolving dependencies on
+ whole SSE registers use APS move to break dependency
+ chains, otherwise use short move to avoid extra work.
+
+ Do the same for architectures resolving dependencies on
+ the parts. While in DF mode it is better to always handle
+ just register parts, the SF mode is different due to lack
+ of instructions to load just part of the register. It is
+ better to maintain the whole registers in single format
+ to avoid problems on using packed logical operations. */
+ (eq_attr "alternative" "6")
+ (if_then_else
+ (ior (ne (symbol_ref "TARGET_SSE_PARTIAL_REG_DEPENDENCY")
+ (const_int 0))
+ (ne (symbol_ref "TARGET_SSE_PARTIAL_REGS")
+ (const_int 0)))
+ (const_string "V4SF")
+ (const_string "SF"))
+ (eq_attr "alternative" "11")
+ (const_string "DI")]
+ (const_string "SF")))])
(define_insn "*swapsf"
[(set (match_operand:SF 0 "register_operand" "+f")
@@ -2188,26 +2261,8 @@
(match_operand:DF 1 "general_no_elim_operand" "f#Y,Fo#fY,*r#fY,Y#f"))]
"!TARGET_64BIT && !TARGET_INTEGER_DFMODE_MOVES"
{
- switch (which_alternative)
- {
- case 0:
- /* %%% We loose REG_DEAD notes for controling pops if we split late. */
- operands[0] = gen_rtx_MEM (DFmode, stack_pointer_rtx);
- operands[2] = stack_pointer_rtx;
- operands[3] = GEN_INT (8);
- if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "sub{l}\t{%3, %2|%2, %3}\;fstp%z0\t%y0";
- else
- return "sub{l}\t{%3, %2|%2, %3}\;fst%z0\t%y0";
-
- case 1:
- case 2:
- case 3:
- return "#";
-
- default:
- abort ();
- }
+ /* This insn should be already splitted before reg-stack. */
+ abort ();
}
[(set_attr "type" "multi")
(set_attr "mode" "DF,SI,SI,DF")])
@@ -2217,32 +2272,8 @@
(match_operand:DF 1 "general_no_elim_operand" "f#rY,rFo#fY,Y#rf"))]
"TARGET_64BIT || TARGET_INTEGER_DFMODE_MOVES"
{
- switch (which_alternative)
- {
- case 0:
- /* %%% We loose REG_DEAD notes for controling pops if we split late. */
- operands[0] = gen_rtx_MEM (DFmode, stack_pointer_rtx);
- operands[2] = stack_pointer_rtx;
- operands[3] = GEN_INT (8);
- if (TARGET_64BIT)
- if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "sub{q}\t{%3, %2|%2, %3}\;fstp%z0\t%y0";
- else
- return "sub{q}\t{%3, %2|%2, %3}\;fst%z0\t%y0";
- else
- if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "sub{l}\t{%3, %2|%2, %3}\;fstp%z0\t%y0";
- else
- return "sub{l}\t{%3, %2|%2, %3}\;fst%z0\t%y0";
-
-
- case 1:
- case 2:
- return "#";
-
- default:
- abort ();
- }
+ /* This insn should be already splitted before reg-stack. */
+ abort ();
}
[(set_attr "type" "multi")
(set_attr "mode" "DF,SI,DF")])
@@ -2279,7 +2310,7 @@
[(set (match_operand:DF 0 "nonimmediate_operand" "=f#Y,m,f#Y,*r,o,Y#f,Y#f,Y#f,m")
(match_operand:DF 1 "general_operand" "fm#Y,f#Y,G,*roF,F*r,C,Y#f,YHm#f,Y#f"))]
"(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
- && (optimize_size || !TARGET_INTEGER_DFMODE_MOVES)
+ && ((optimize_size || !TARGET_INTEGER_DFMODE_MOVES) && !TARGET_64BIT)
&& (reload_in_progress || reload_completed
|| (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
|| GET_CODE (operands[1]) != CONST_DOUBLE
@@ -2290,7 +2321,12 @@
case 0:
if (REG_P (operands[1])
&& find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp\t%y0";
+ {
+ 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
@@ -2316,31 +2352,84 @@
case 4:
return "#";
case 5:
- if (TARGET_ATHLON)
- return "xorpd\t%0, %0";
- else
- return "pxor\t%0, %0";
+ switch (get_attr_mode (insn))
+ {
+ case MODE_V4SF:
+ return "xorps\t%0, %0";
+ case MODE_V2DF:
+ return "xorpd\t%0, %0";
+ case MODE_TI:
+ return "pxor\t%0, %0";
+ default:
+ abort ();
+ }
case 6:
- if (TARGET_PARTIAL_REG_DEPENDENCY)
- return "movapd\t{%1, %0|%0, %1}";
+ switch (get_attr_mode (insn))
+ {
+ case MODE_V4SF:
+ return "movaps\t{%1, %0|%0, %1}";
+ case MODE_V2DF:
+ return "movapd\t{%1, %0|%0, %1}";
+ case MODE_DF:
+ return "movsd\t{%1, %0|%0, %1}";
+ default:
+ abort ();
+ }
+ case 7:
+ if (get_attr_mode (insn) == MODE_V2DF)
+ return "movlpd\t{%1, %0|%0, %1}";
else
return "movsd\t{%1, %0|%0, %1}";
- case 7:
case 8:
- return "movsd\t{%1, %0|%0, %1}";
+ return "movsd\t{%1, %0|%0, %1}";
default:
abort();
}
}
[(set_attr "type" "fmov,fmov,fmov,multi,multi,ssemov,ssemov,ssemov,ssemov")
- (set_attr "mode" "DF,DF,DF,SI,SI,TI,DF,DF,DF")])
+ (set (attr "mode")
+ (cond [(eq_attr "alternative" "3,4")
+ (const_string "SI")
+ /* xorps is one byte shorter. */
+ (eq_attr "alternative" "5")
+ (cond [(ne (symbol_ref "optimize_size")
+ (const_int 0))
+ (const_string "V4SF")
+ (ne (symbol_ref "TARGET_SSE_LOAD0_BY_PXOR")
+ (const_int 0))
+ (const_string "TI")]
+ (const_string "V2DF"))
+ /* For architectures resolving dependencies on
+ whole SSE registers use APD move to break dependency
+ chains, otherwise use short move to avoid extra work.
+
+ movaps encodes one byte shorter. */
+ (eq_attr "alternative" "6")
+ (cond
+ [(ne (symbol_ref "optimize_size")
+ (const_int 0))
+ (const_string "V4SF")
+ (ne (symbol_ref "TARGET_SSE_PARTIAL_REG_DEPENDENCY")
+ (const_int 0))
+ (const_string "V2DF")]
+ (const_string "DF"))
+ /* For achitectures resolving dependencies on register
+ parts we may avoid extra work to zero out upper part
+ of register. */
+ (eq_attr "alternative" "7")
+ (if_then_else
+ (ne (symbol_ref "TARGET_SSE_PARTIAL_REGS")
+ (const_int 0))
+ (const_string "V2DF")
+ (const_string "DF"))]
+ (const_string "DF")))])
(define_insn "*movdf_integer"
[(set (match_operand:DF 0 "nonimmediate_operand" "=f#Yr,m,f#Yr,r#Yf,o,Y#rf,Y#rf,Y#rf,m")
(match_operand:DF 1 "general_operand" "fm#Yr,f#Yr,G,roF#Yf,Fr#Yf,C,Y#rf,Ym#rf,Y#rf"))]
"(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
- && !optimize_size && TARGET_INTEGER_DFMODE_MOVES
+ && ((!optimize_size && TARGET_INTEGER_DFMODE_MOVES) || TARGET_64BIT)
&& (reload_in_progress || reload_completed
|| (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
|| GET_CODE (operands[1]) != CONST_DOUBLE
@@ -2351,7 +2440,12 @@
case 0:
if (REG_P (operands[1])
&& find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp\t%y0";
+ {
+ 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
@@ -2378,16 +2472,34 @@
return "#";
case 5:
- if (TARGET_ATHLON)
- return "xorpd\t%0, %0";
- else
- return "pxor\t%0, %0";
+ switch (get_attr_mode (insn))
+ {
+ case MODE_V4SF:
+ return "xorps\t%0, %0";
+ case MODE_V2DF:
+ return "xorpd\t%0, %0";
+ case MODE_TI:
+ return "pxor\t%0, %0";
+ default:
+ abort ();
+ }
case 6:
- if (TARGET_PARTIAL_REG_DEPENDENCY)
- return "movapd\t{%1, %0|%0, %1}";
+ switch (get_attr_mode (insn))
+ {
+ case MODE_V4SF:
+ return "movaps\t{%1, %0|%0, %1}";
+ case MODE_V2DF:
+ return "movapd\t{%1, %0|%0, %1}";
+ case MODE_DF:
+ return "movsd\t{%1, %0|%0, %1}";
+ default:
+ abort ();
+ }
+ case 7:
+ if (get_attr_mode (insn) == MODE_V2DF)
+ return "movlpd\t{%1, %0|%0, %1}";
else
return "movsd\t{%1, %0|%0, %1}";
- case 7:
case 8:
return "movsd\t{%1, %0|%0, %1}";
@@ -2396,7 +2508,42 @@
}
}
[(set_attr "type" "fmov,fmov,fmov,multi,multi,ssemov,ssemov,ssemov,ssemov")
- (set_attr "mode" "DF,DF,DF,SI,SI,TI,DF,DF,DF")])
+ (set (attr "mode")
+ (cond [(eq_attr "alternative" "3,4")
+ (const_string "SI")
+ /* xorps is one byte shorter. */
+ (eq_attr "alternative" "5")
+ (cond [(ne (symbol_ref "optimize_size")
+ (const_int 0))
+ (const_string "V4SF")
+ (ne (symbol_ref "TARGET_SSE_LOAD0_BY_PXOR")
+ (const_int 0))
+ (const_string "TI")]
+ (const_string "V2DF"))
+ /* For architectures resolving dependencies on
+ whole SSE registers use APD move to break dependency
+ chains, otherwise use short move to avoid extra work.
+
+ movaps encodes one byte shorter. */
+ (eq_attr "alternative" "6")
+ (cond
+ [(ne (symbol_ref "optimize_size")
+ (const_int 0))
+ (const_string "V4SF")
+ (ne (symbol_ref "TARGET_SSE_PARTIAL_REG_DEPENDENCY")
+ (const_int 0))
+ (const_string "V2DF")]
+ (const_string "DF"))
+ /* For achitectures resolving dependencies on register
+ parts we may avoid extra work to zero out upper part
+ of register. */
+ (eq_attr "alternative" "7")
+ (if_then_else
+ (ne (symbol_ref "TARGET_SSE_PARTIAL_REGS")
+ (const_int 0))
+ (const_string "V2DF")
+ (const_string "DF"))]
+ (const_string "DF")))])
(define_split
[(set (match_operand:DF 0 "nonimmediate_operand" "")
@@ -2451,25 +2598,8 @@
(match_operand:XF 1 "general_no_elim_operand" "f,Fo,*r"))]
"!TARGET_64BIT && optimize_size"
{
- switch (which_alternative)
- {
- case 0:
- /* %%% We loose REG_DEAD notes for controling pops if we split late. */
- operands[0] = gen_rtx_MEM (XFmode, stack_pointer_rtx);
- operands[2] = stack_pointer_rtx;
- operands[3] = GEN_INT (12);
- if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "sub{l}\t{%3, %2|%2, %3}\;fstp%z0\t%y0";
- else
- return "sub{l}\t{%3, %2|%2, %3}\;fst%z0\t%y0";
-
- case 1:
- case 2:
- return "#";
-
- default:
- abort ();
- }
+ /* This insn should be already splitted before reg-stack. */
+ abort ();
}
[(set_attr "type" "multi")
(set_attr "mode" "XF,SI,SI")])
@@ -2479,25 +2609,8 @@
(match_operand:TF 1 "general_no_elim_operand" "f,Fo,*r"))]
"optimize_size"
{
- switch (which_alternative)
- {
- case 0:
- /* %%% We loose REG_DEAD notes for controling pops if we split late. */
- operands[0] = gen_rtx_MEM (XFmode, stack_pointer_rtx);
- operands[2] = stack_pointer_rtx;
- operands[3] = GEN_INT (16);
- if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "sub{l}\t{%3, %2|%2, %3}\;fstp%z0\t%y0";
- else
- return "sub{l}\t{%3, %2|%2, %3}\;fst%z0\t%y0";
-
- case 1:
- case 2:
- return "#";
-
- default:
- abort ();
- }
+ /* This insn should be already splitted before reg-stack. */
+ abort ();
}
[(set_attr "type" "multi")
(set_attr "mode" "XF,SI,SI")])
@@ -2507,24 +2620,8 @@
(match_operand:XF 1 "general_no_elim_operand" "f#r,ro#f"))]
"!TARGET_64BIT && !optimize_size"
{
- switch (which_alternative)
- {
- case 0:
- /* %%% We loose REG_DEAD notes for controling pops if we split late. */
- operands[0] = gen_rtx_MEM (XFmode, stack_pointer_rtx);
- operands[2] = stack_pointer_rtx;
- operands[3] = GEN_INT (12);
- if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "sub{l}\t{%3, %2|%2, %3}\;fstp%z0\t%y0";
- else
- return "sub{l}\t{%3, %2|%2, %3}\;fst%z0\t%y0";
-
- case 1:
- return "#";
-
- default:
- abort ();
- }
+ /* This insn should be already splitted before reg-stack. */
+ abort ();
}
[(set_attr "type" "multi")
(set_attr "mode" "XF,SI")])
@@ -2534,30 +2631,8 @@
(match_operand:TF 1 "general_no_elim_operand" "f#r,rFo#f"))]
"!optimize_size"
{
- switch (which_alternative)
- {
- case 0:
- /* %%% We loose REG_DEAD notes for controling pops if we split late. */
- operands[0] = gen_rtx_MEM (XFmode, stack_pointer_rtx);
- operands[2] = stack_pointer_rtx;
- operands[3] = GEN_INT (16);
- if (TARGET_64BIT)
- if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "sub{q}\t{%3, %2|%2, %3}\;fstp%z0\t%y0";
- else
- return "sub{q}\t{%3, %2|%2, %3}\;fst%z0\t%y0";
- else
- if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "sub{l}\t{%3, %2|%2, %3}\;fstp%z0\t%y0";
- else
- return "sub{l}\t{%3, %2|%2, %3}\;fst%z0\t%y0";
-
- case 1:
- return "#";
-
- default:
- abort ();
- }
+ /* This insn should be already splitted before reg-stack. */
+ abort ();
}
[(set_attr "type" "multi")
(set_attr "mode" "XF,SI")])
@@ -2610,7 +2685,12 @@
case 0:
if (REG_P (operands[1])
&& find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp\t%y0";
+ {
+ 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
@@ -2657,7 +2737,12 @@
case 0:
if (REG_P (operands[1])
&& find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp\t%y0";
+ {
+ 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
@@ -2704,7 +2789,12 @@
case 0:
if (REG_P (operands[1])
&& find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp\t%y0";
+ {
+ 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
@@ -2751,7 +2841,12 @@
case 0:
if (REG_P (operands[1])
&& find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp\t%y0";
+ {
+ 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
@@ -3699,11 +3794,11 @@
(set_attr "mode" "SF,SF,SF,SF")])
(define_insn "*truncdfsf2_1_sse"
- [(set (match_operand:SF 0 "nonimmediate_operand" "=*!m,?f#rx,?r#fx,?x#rf,Y")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=*!m#fxr,?f#xr,?r#fx,?x#fr,Y#fr")
(float_truncate:SF
- (match_operand:DF 1 "nonimmediate_operand" "f,f,f,f,mY")))
+ (match_operand:DF 1 "nonimmediate_operand" "f#Y,f#Y,f#Y,f#Y,mY#f")))
(clobber (match_operand:SF 2 "memory_operand" "=X,m,m,m,X"))]
- "TARGET_80387 && TARGET_SSE2"
+ "TARGET_80387 && TARGET_SSE2 && !TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS"
{
switch (which_alternative)
{
@@ -3713,7 +3808,30 @@
else
return "fst%z0\t%y0";
case 4:
- return "cvtsd2ss\t{%1, %0|%0, %1}";
+ return "#";
+ default:
+ abort ();
+ }
+}
+ [(set_attr "type" "fmov,multi,multi,multi,ssecvt")
+ (set_attr "mode" "SF,SF,SF,SF,DF")])
+
+(define_insn "*truncdfsf2_1_sse_nooverlap"
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=*!m,?f#rx,?r#fx,?x#rf,&Y")
+ (float_truncate:SF
+ (match_operand:DF 1 "nonimmediate_operand" "f#Y,f#Y,f#Y,f#Y,mY#f")))
+ (clobber (match_operand:SF 2 "memory_operand" "=X,m,m,m,X"))]
+ "TARGET_80387 && TARGET_SSE2 && TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS"
+{
+ 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";
+ case 4:
+ return "#";
default:
abort ();
}
@@ -3724,8 +3842,8 @@
(define_insn "*truncdfsf2_2"
[(set (match_operand:SF 0 "nonimmediate_operand" "=Y,!m")
(float_truncate:SF
- (match_operand:DF 1 "nonimmediate_operand" "mY,f")))]
- "TARGET_80387 && TARGET_SSE2
+ (match_operand:DF 1 "nonimmediate_operand" "mY,f#Y")))]
+ "TARGET_80387 && TARGET_SSE2 && !TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS
&& (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)"
{
switch (which_alternative)
@@ -3744,7 +3862,30 @@
[(set_attr "type" "ssecvt,fmov")
(set_attr "mode" "DF,SF")])
-(define_insn "truncdfsf2_3"
+(define_insn "*truncdfsf2_2_nooverlap"
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=&Y,!m")
+ (float_truncate:SF
+ (match_operand:DF 1 "nonimmediate_operand" "mY,f")))]
+ "TARGET_80387 && TARGET_SSE2 && TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS
+ && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)"
+{
+ switch (which_alternative)
+ {
+ case 0:
+ return "#";
+ case 1:
+ 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" "ssecvt,fmov")
+ (set_attr "mode" "DF,SF")])
+
+(define_insn "*truncdfsf2_3"
[(set (match_operand:SF 0 "memory_operand" "=m")
(float_truncate:SF
(match_operand:DF 1 "register_operand" "f")))]
@@ -3762,11 +3903,20 @@
[(set (match_operand:SF 0 "register_operand" "=Y")
(float_truncate:SF
(match_operand:DF 1 "nonimmediate_operand" "mY")))]
- "!TARGET_80387 && TARGET_SSE2"
+ "!TARGET_80387 && TARGET_SSE2 && !TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS"
"cvtsd2ss\t{%1, %0|%0, %1}"
[(set_attr "type" "ssecvt")
(set_attr "mode" "DF")])
+(define_insn "*truncdfsf2_sse_only_nooverlap"
+ [(set (match_operand:SF 0 "register_operand" "=&Y")
+ (float_truncate:SF
+ (match_operand:DF 1 "nonimmediate_operand" "mY")))]
+ "!TARGET_80387 && TARGET_SSE2 && TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS"
+ "#"
+ [(set_attr "type" "ssecvt")
+ (set_attr "mode" "DF")])
+
(define_split
[(set (match_operand:SF 0 "memory_operand" "")
(float_truncate:SF
@@ -3776,15 +3926,56 @@
[(set (match_dup 0) (float_truncate:SF (match_dup 1)))]
"")
+; Avoid possible reformating penalty on the destination by first
+; zeroing it out
(define_split
- [(set (match_operand:SF 0 "nonimmediate_operand" "")
+ [(set (match_operand:SF 0 "register_operand" "")
(float_truncate:SF
(match_operand:DF 1 "nonimmediate_operand" "")))
(clobber (match_operand 2 "" ""))]
"TARGET_80387 && reload_completed
- && !FP_REG_P (operands[0]) && !FP_REG_P (operands[1])"
- [(set (match_dup 0) (float_truncate:SF (match_dup 1)))]
- "")
+ && SSE_REG_P (operands[0])
+ && !STACK_REG_P (operands[1])"
+ [(const_int 0)]
+{
+ rtx src, dest;
+ if (!TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS)
+ emit_insn (gen_truncdfsf2_sse_only (operands[0], operands[1]));
+ else
+ {
+ dest = simplify_gen_subreg (V4SFmode, operands[0], SFmode, 0);
+ src = simplify_gen_subreg (V2DFmode, operands[1], DFmode, 0);
+ /* simplify_gen_subreg refuses to widen memory references. */
+ if (GET_CODE (src) == SUBREG)
+ alter_subreg (&src);
+ if (reg_overlap_mentioned_p (operands[0], operands[1]))
+ abort ();
+ emit_insn (gen_sse_clrv4sf (dest, CONST0_RTX (V4SFmode)));
+ emit_insn (gen_cvtsd2ss (dest, dest, src));
+ }
+ DONE;
+})
+
+(define_split
+ [(set (match_operand:SF 0 "register_operand" "")
+ (float_truncate:SF
+ (match_operand:DF 1 "nonimmediate_operand" "")))]
+ "TARGET_80387 && reload_completed
+ && SSE_REG_P (operands[0]) && TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS"
+ [(const_int 0)]
+{
+ rtx src, dest;
+ dest = simplify_gen_subreg (V4SFmode, operands[0], SFmode, 0);
+ src = simplify_gen_subreg (V2DFmode, operands[1], DFmode, 0);
+ /* simplify_gen_subreg refuses to widen memory references. */
+ if (GET_CODE (src) == SUBREG)
+ alter_subreg (&src);
+ if (reg_overlap_mentioned_p (operands[0], operands[1]))
+ abort ();
+ emit_insn (gen_sse_clrv4sf (dest, CONST0_RTX (V4SFmode)));
+ emit_insn (gen_cvtsd2ss (dest, dest, src));
+ DONE;
+})
(define_split
[(set (match_operand:SF 0 "register_operand" "")
@@ -4468,7 +4659,7 @@
"")
(define_insn "*floatsisf2_i387"
- [(set (match_operand:SF 0 "register_operand" "=f,?f,x")
+ [(set (match_operand:SF 0 "register_operand" "=f#x,?f#x,x#f")
(float:SF (match_operand:SI 1 "nonimmediate_operand" "m,r,mr")))]
"TARGET_80387 && (!TARGET_SSE || TARGET_MIX_SSE_I387)"
"@
@@ -4488,6 +4679,22 @@
(set_attr "mode" "SF")
(set_attr "fp_int_src" "true")])
+; Avoid possible reformating penalty on the destination by first
+; zeroing it out
+(define_split
+ [(set (match_operand:SF 0 "register_operand" "")
+ (float:SF (match_operand:SI 1 "nonimmediate_operand" "")))]
+ "TARGET_80387 && reload_completed && TARGET_SSE_PARTIAL_REGS
+ && SSE_REG_P (operands[0])"
+ [(const_int 0)]
+{
+ rtx dest;
+ dest = simplify_gen_subreg (V4SFmode, operands[0], SFmode, 0);
+ emit_insn (gen_sse_clrv4sf (dest, CONST0_RTX (V4SFmode)));
+ emit_insn (gen_cvtsi2ss (dest, dest, operands[1]));
+ DONE;
+})
+
(define_expand "floatdisf2"
[(set (match_operand:SF 0 "register_operand" "")
(float:SF (match_operand:DI 1 "nonimmediate_operand" "")))]
@@ -4506,7 +4713,7 @@
(set_attr "fp_int_src" "true")])
(define_insn "*floatdisf2_i387"
- [(set (match_operand:SF 0 "register_operand" "=f,?f,x")
+ [(set (match_operand:SF 0 "register_operand" "=f#x,?f#x,x#f")
(float:SF (match_operand:DI 1 "nonimmediate_operand" "m,r,mr")))]
"TARGET_64BIT && TARGET_80387 && (!TARGET_SSE || TARGET_MIX_SSE_I387)"
"@
@@ -4526,6 +4733,22 @@
(set_attr "mode" "SF")
(set_attr "fp_int_src" "true")])
+; Avoid possible reformating penalty on the destination by first
+; zeroing it out
+(define_split
+ [(set (match_operand:SF 0 "register_operand" "")
+ (float:SF (match_operand:DI 1 "nonimmediate_operand" "")))]
+ "TARGET_80387 && reload_completed && TARGET_SSE_PARTIAL_REGS
+ && SSE_REG_P (operands[0])"
+ [(const_int 0)]
+{
+ rtx dest;
+ dest = simplify_gen_subreg (V4SFmode, operands[0], SFmode, 0);
+ emit_insn (gen_sse_clrv4sf (dest, CONST0_RTX (V4SFmode)));
+ emit_insn (gen_cvtsi2ssq (dest, dest, operands[1]));
+ DONE;
+})
+
(define_insn "floathidf2"
[(set (match_operand:DF 0 "register_operand" "=f,f")
(float:DF (match_operand:HI 1 "nonimmediate_operand" "m,r")))]
@@ -4544,7 +4767,7 @@
"")
(define_insn "*floatsidf2_i387"
- [(set (match_operand:DF 0 "register_operand" "=f,?f,Y")
+ [(set (match_operand:DF 0 "register_operand" "=f#Y,?f#Y,Y#f")
(float:DF (match_operand:SI 1 "nonimmediate_operand" "m,r,mr")))]
"TARGET_80387 && (!TARGET_SSE2 || TARGET_MIX_SSE_I387)"
"@
@@ -4582,7 +4805,7 @@
(set_attr "fp_int_src" "true")])
(define_insn "*floatdidf2_i387"
- [(set (match_operand:DF 0 "register_operand" "=f,?f,Y")
+ [(set (match_operand:DF 0 "register_operand" "=f#Y,?f#Y,Y#f")
(float:DF (match_operand:DI 1 "nonimmediate_operand" "m,r,mr")))]
"TARGET_64BIT && TARGET_80387 && (!TARGET_SSE2 || TARGET_MIX_SSE_I387)"
"@
@@ -9269,12 +9492,15 @@
in register. */
rtx reg = gen_reg_rtx (SFmode);
rtx dest = operands[0];
+ rtx imm = gen_lowpart (SFmode, gen_int_mode (0x80000000, SImode));
operands[1] = force_reg (SFmode, operands[1]);
operands[0] = force_reg (SFmode, operands[0]);
- emit_move_insn (reg,
- gen_lowpart (SFmode,
- gen_int_mode (0x80000000, SImode)));
+ reg = force_reg (V4SFmode,
+ gen_rtx_CONST_VECTOR (V4SFmode,
+ gen_rtvec (4, imm, CONST0_RTX (SFmode),
+ CONST0_RTX (SFmode),
+ CONST0_RTX (SFmode))));
emit_insn (gen_negsf2_ifs (operands[0], operands[1], reg));
if (dest != operands[0])
emit_move_insn (dest, operands[0]);
@@ -9293,7 +9519,7 @@
(define_insn "negsf2_ifs"
[(set (match_operand:SF 0 "nonimmediate_operand" "=x#fr,x#fr,f#xr,rm#xf")
(neg:SF (match_operand:SF 1 "nonimmediate_operand" "0,x#fr,0,0")))
- (use (match_operand:SF 2 "nonmemory_operand" "x,0#x,*g#x,*g#x"))
+ (use (match_operand:V4SF 2 "nonimmediate_operand" "xm,0,xm*r,xm*r"))
(clobber (reg:CC 17))]
"TARGET_SSE
&& (reload_in_progress || reload_completed
@@ -9314,7 +9540,7 @@
(define_split
[(set (match_operand:SF 0 "register_operand" "")
(neg:SF (match_operand:SF 1 "register_operand" "")))
- (use (match_operand:SF 2 "" ""))
+ (use (match_operand:V4SF 2 "" ""))
(clobber (reg:CC 17))]
"reload_completed && !SSE_REG_P (operands[0])"
[(parallel [(set (match_dup 0)
@@ -9324,13 +9550,15 @@
(define_split
[(set (match_operand:SF 0 "register_operand" "")
(neg:SF (match_operand:SF 1 "register_operand" "")))
- (use (match_operand:SF 2 "register_operand" ""))
+ (use (match_operand:V4SF 2 "nonimmediate_operand" ""))
(clobber (reg:CC 17))]
"reload_completed && SSE_REG_P (operands[0])"
[(set (subreg:TI (match_dup 0) 0)
- (xor:TI (subreg:TI (match_dup 1) 0)
- (subreg:TI (match_dup 2) 0)))]
+ (xor:TI (match_dup 1)
+ (match_dup 2)))]
{
+ operands[1] = simplify_gen_subreg (TImode, operands[1], SFmode, 0);
+ operands[2] = simplify_gen_subreg (TImode, operands[2], V4SFmode, 0);
if (operands_match_p (operands[0], operands[2]))
{
rtx tmp;
@@ -9403,7 +9631,7 @@
{
/* Using SSE is tricky, since we need bitwise negation of -0
in register. */
- rtx reg = gen_reg_rtx (DFmode);
+ rtx reg;
#if HOST_BITS_PER_WIDE_INT >= 64
rtx imm = gen_int_mode (((HOST_WIDE_INT)1) << 63, DImode);
#else
@@ -9413,7 +9641,10 @@
operands[1] = force_reg (DFmode, operands[1]);
operands[0] = force_reg (DFmode, operands[0]);
- emit_move_insn (reg, gen_lowpart (DFmode, imm));
+ imm = gen_lowpart (DFmode, imm);
+ reg = force_reg (V2DFmode,
+ gen_rtx_CONST_VECTOR (V2DFmode,
+ gen_rtvec (2, imm, CONST0_RTX (DFmode))));
emit_insn (gen_negdf2_ifs (operands[0], operands[1], reg));
if (dest != operands[0])
emit_move_insn (dest, operands[0]);
@@ -9432,7 +9663,7 @@
(define_insn "negdf2_ifs"
[(set (match_operand:DF 0 "nonimmediate_operand" "=Y#fr,Y#fr,f#Yr,rm#Yf")
(neg:DF (match_operand:DF 1 "nonimmediate_operand" "0,Y#fr,0,0")))
- (use (match_operand:DF 2 "nonmemory_operand" "Y,0,*g#Y,*g#Y"))
+ (use (match_operand:V2DF 2 "nonimmediate_operand" "Ym,0,Ym*r,Ym*r"))
(clobber (reg:CC 17))]
"!TARGET_64BIT && TARGET_SSE2
&& (reload_in_progress || reload_completed
@@ -9442,8 +9673,8 @@
(define_insn "*negdf2_ifs_rex64"
[(set (match_operand:DF 0 "nonimmediate_operand" "=Y#f,Y#f,fm#Y")
- (neg:DF (match_operand:DF 1 "nonimmediate_operand" "0,Y#f,0")))
- (use (match_operand:DF 2 "general_operand" "Y,0,*g#Y*r"))
+ (neg:DF (match_operand:DF 1 "nonimmediate_operand" "0,Y#fr,0")))
+ (use (match_operand:V2DF 2 "nonimmediate_operand" "Ym,0,Ym*r"))
(clobber (reg:CC 17))]
"TARGET_64BIT && TARGET_SSE2
&& (reload_in_progress || reload_completed
@@ -9454,7 +9685,7 @@
(define_split
[(set (match_operand:DF 0 "memory_operand" "")
(neg:DF (match_operand:DF 1 "memory_operand" "")))
- (use (match_operand:DF 2 "" ""))
+ (use (match_operand:V2DF 2 "" ""))
(clobber (reg:CC 17))]
""
[(parallel [(set (match_dup 0)
@@ -9464,7 +9695,7 @@
(define_split
[(set (match_operand:DF 0 "register_operand" "")
(neg:DF (match_operand:DF 1 "register_operand" "")))
- (use (match_operand:DF 2 "" ""))
+ (use (match_operand:V2DF 2 "" ""))
(clobber (reg:CC 17))]
"reload_completed && !SSE_REG_P (operands[0])
&& (!TARGET_64BIT || FP_REG_P (operands[0]))"
@@ -9475,7 +9706,7 @@
(define_split
[(set (match_operand:DF 0 "register_operand" "")
(neg:DF (match_operand:DF 1 "register_operand" "")))
- (use (match_operand:DF 2 "" ""))
+ (use (match_operand:V2DF 2 "" ""))
(clobber (reg:CC 17))]
"TARGET_64BIT && reload_completed && GENERAL_REG_P (operands[0])"
[(parallel [(set (match_dup 0)
@@ -9488,13 +9719,19 @@
(define_split
[(set (match_operand:DF 0 "register_operand" "")
(neg:DF (match_operand:DF 1 "register_operand" "")))
- (use (match_operand:DF 2 "register_operand" ""))
+ (use (match_operand:V2DF 2 "nonimmediate_operand" ""))
(clobber (reg:CC 17))]
"reload_completed && SSE_REG_P (operands[0])"
[(set (subreg:TI (match_dup 0) 0)
- (xor:TI (subreg:TI (match_dup 1) 0)
- (subreg:TI (match_dup 2) 0)))]
+ (xor:TI (match_dup 1)
+ (match_dup 2)))]
{
+ operands[0] = simplify_gen_subreg (V2DFmode, operands[0], DFmode, 0);
+ operands[1] = simplify_gen_subreg (TImode, operands[1], DFmode, 0);
+ operands[2] = simplify_gen_subreg (TImode, operands[2], V2DFmode, 0);
+ /* Avoid possible reformating on the operands. */
+ if (TARGET_SSE_PARTIAL_REGS && !optimize_size)
+ emit_insn (gen_sse2_unpcklpd (operands[0], operands[0], operands[0]));
if (operands_match_p (operands[0], operands[2]))
{
rtx tmp;
@@ -9727,14 +9964,18 @@
{
/* Using SSE is tricky, since we need bitwise negation of -0
in register. */
- rtx reg = gen_reg_rtx (SFmode);
+ rtx reg = gen_reg_rtx (V4SFmode);
rtx dest = operands[0];
+ rtx imm;
operands[1] = force_reg (SFmode, operands[1]);
operands[0] = force_reg (SFmode, operands[0]);
- emit_move_insn (reg,
- gen_lowpart (SFmode,
- gen_int_mode (0x80000000, SImode)));
+ imm = gen_lowpart (SFmode, gen_int_mode(~0x80000000, SImode));
+ reg = force_reg (V4SFmode,
+ gen_rtx_CONST_VECTOR (V4SFmode,
+ gen_rtvec (4, imm, CONST0_RTX (SFmode),
+ CONST0_RTX (SFmode),
+ CONST0_RTX (SFmode))));
emit_insn (gen_abssf2_ifs (operands[0], operands[1], reg));
if (dest != operands[0])
emit_move_insn (dest, operands[0]);
@@ -9751,20 +9992,20 @@
"#")
(define_insn "abssf2_ifs"
- [(set (match_operand:SF 0 "nonimmediate_operand" "=x#fr,f#xr,rm#xf")
- (abs:SF (match_operand:SF 1 "nonimmediate_operand" "x,0,0")))
- (use (match_operand:SF 2 "nonmemory_operand" "*0#x,*g#x,*g#x"))
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=x#fr,x#fr,f#xr,rm#xf")
+ (abs:SF (match_operand:SF 1 "nonimmediate_operand" "0,x#fr,0,0")))
+ (use (match_operand:V4SF 2 "nonimmediate_operand" "xm,0,xm*r,xm*r"))
(clobber (reg:CC 17))]
"TARGET_SSE
&& (reload_in_progress || reload_completed
|| (register_operand (operands[0], VOIDmode)
- && register_operand (operands[1], VOIDmode)))"
+ && register_operand (operands[1], VOIDmode)))"
"#")
(define_split
[(set (match_operand:SF 0 "memory_operand" "")
(abs:SF (match_operand:SF 1 "memory_operand" "")))
- (use (match_operand:SF 2 "" ""))
+ (use (match_operand:V4SF 2 "" ""))
(clobber (reg:CC 17))]
""
[(parallel [(set (match_dup 0)
@@ -9774,7 +10015,7 @@
(define_split
[(set (match_operand:SF 0 "register_operand" "")
(abs:SF (match_operand:SF 1 "register_operand" "")))
- (use (match_operand:SF 2 "" ""))
+ (use (match_operand:V4SF 2 "" ""))
(clobber (reg:CC 17))]
"reload_completed && !SSE_REG_P (operands[0])"
[(parallel [(set (match_dup 0)
@@ -9784,12 +10025,23 @@
(define_split
[(set (match_operand:SF 0 "register_operand" "")
(abs:SF (match_operand:SF 1 "register_operand" "")))
- (use (match_operand:SF 2 "register_operand" ""))
+ (use (match_operand:V4SF 2 "nonimmediate_operand" ""))
(clobber (reg:CC 17))]
"reload_completed && SSE_REG_P (operands[0])"
[(set (subreg:TI (match_dup 0) 0)
- (and:TI (not:TI (subreg:TI (match_dup 2) 0))
- (subreg:TI (match_dup 1) 0)))])
+ (and:TI (match_dup 1)
+ (match_dup 2)))]
+{
+ operands[1] = simplify_gen_subreg (TImode, operands[1], SFmode, 0);
+ operands[2] = simplify_gen_subreg (TImode, operands[2], V4SFmode, 0);
+ if (operands_match_p (operands[0], operands[2]))
+ {
+ rtx tmp;
+ tmp = operands[1];
+ operands[1] = operands[2];
+ operands[2] = tmp;
+ }
+})
;; Keep 'f' and 'r' in separate alternatives to avoid reload problems
;; because of secondary memory needed to reload from class FLOAT_INT_REGS
@@ -9852,17 +10104,22 @@
{
/* Using SSE is tricky, since we need bitwise negation of -0
in register. */
- rtx reg = gen_reg_rtx (DFmode);
+ rtx reg = gen_reg_rtx (V2DFmode);
#if HOST_BITS_PER_WIDE_INT >= 64
- rtx imm = gen_int_mode (((HOST_WIDE_INT)1) << 63, DImode);
+ rtx imm = gen_int_mode (~(((HOST_WIDE_INT)1) << 63), DImode);
#else
- rtx imm = immed_double_const (0, 0x80000000, DImode);
+ rtx imm = immed_double_const (~0, ~0x80000000, DImode);
#endif
rtx dest = operands[0];
operands[1] = force_reg (DFmode, operands[1]);
operands[0] = force_reg (DFmode, operands[0]);
- emit_move_insn (reg, gen_lowpart (DFmode, imm));
+
+ /* Produce LONG_DOUBLE with the proper immediate argument. */
+ imm = gen_lowpart (DFmode, imm);
+ reg = force_reg (V2DFmode,
+ gen_rtx_CONST_VECTOR (V2DFmode,
+ gen_rtvec (2, imm, CONST0_RTX (DFmode))));
emit_insn (gen_absdf2_ifs (operands[0], operands[1], reg));
if (dest != operands[0])
emit_move_insn (dest, operands[0]);
@@ -9879,9 +10136,9 @@
"#")
(define_insn "absdf2_ifs"
- [(set (match_operand:DF 0 "nonimmediate_operand" "=Y#fr,mf#Yr,mr#Yf")
- (abs:DF (match_operand:DF 1 "nonimmediate_operand" "Y,0,0")))
- (use (match_operand:DF 2 "nonmemory_operand" "*0#Y,*g#Y,*g#Y"))
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=Y#fr,Y#fr,mf#Yr,mr#Yf")
+ (abs:DF (match_operand:DF 1 "nonimmediate_operand" "0,Y#fr,0,0")))
+ (use (match_operand:V2DF 2 "nonimmediate_operand" "Ym,0,Ym*r,Ym*r"))
(clobber (reg:CC 17))]
"!TARGET_64BIT && TARGET_SSE2
&& (reload_in_progress || reload_completed
@@ -9890,9 +10147,9 @@
"#")
(define_insn "*absdf2_ifs_rex64"
- [(set (match_operand:DF 0 "nonimmediate_operand" "=Y#fr,mf#Yr")
- (abs:DF (match_operand:DF 1 "nonimmediate_operand" "Y,0")))
- (use (match_operand:DF 2 "nonmemory_operand" "*0#Y,*g#Y"))
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=Y#fr,Y#fr,mf#Yr")
+ (abs:DF (match_operand:DF 1 "nonimmediate_operand" "0,Y#fr,0")))
+ (use (match_operand:V2DF 2 "nonimmediate_operand" "Ym,0,Ym*r"))
(clobber (reg:CC 17))]
"TARGET_64BIT && TARGET_SSE2
&& (reload_in_progress || reload_completed
@@ -9903,7 +10160,7 @@
(define_split
[(set (match_operand:DF 0 "memory_operand" "")
(abs:DF (match_operand:DF 1 "memory_operand" "")))
- (use (match_operand:DF 2 "" ""))
+ (use (match_operand:V2DF 2 "" ""))
(clobber (reg:CC 17))]
""
[(parallel [(set (match_dup 0)
@@ -9913,7 +10170,7 @@
(define_split
[(set (match_operand:DF 0 "register_operand" "")
(abs:DF (match_operand:DF 1 "register_operand" "")))
- (use (match_operand:DF 2 "" ""))
+ (use (match_operand:V2DF 2 "" ""))
(clobber (reg:CC 17))]
"reload_completed && !SSE_REG_P (operands[0])"
[(parallel [(set (match_dup 0)
@@ -9923,12 +10180,27 @@
(define_split
[(set (match_operand:DF 0 "register_operand" "")
(abs:DF (match_operand:DF 1 "register_operand" "")))
- (use (match_operand:DF 2 "register_operand" ""))
+ (use (match_operand:V2DF 2 "nonimmediate_operand" ""))
(clobber (reg:CC 17))]
"reload_completed && SSE_REG_P (operands[0])"
[(set (subreg:TI (match_dup 0) 0)
- (and:TI (not:TI (subreg:TI (match_dup 2) 0))
- (subreg:TI (match_dup 1) 0)))])
+ (and:TI (match_dup 1)
+ (match_dup 2)))]
+{
+ operands[0] = simplify_gen_subreg (V2DFmode, operands[0], DFmode, 0);
+ operands[1] = simplify_gen_subreg (TImode, operands[1], DFmode, 0);
+ operands[2] = simplify_gen_subreg (TImode, operands[2], V2DFmode, 0);
+ /* Avoid possible reformating on the operands. */
+ if (TARGET_SSE_PARTIAL_REGS && !optimize_size)
+ emit_insn (gen_sse2_unpcklpd (operands[0], operands[0], operands[0]));
+ if (operands_match_p (operands[0], operands[2]))
+ {
+ rtx tmp;
+ tmp = operands[1];
+ operands[1] = operands[2];
+ operands[2] = tmp;
+ }
+})
;; Keep 'f' and 'r' in separate alternatives to avoid reload problems
@@ -13367,7 +13639,7 @@
(match_operand:SI 3 "" "")))])]
"!TARGET_64BIT"
{
- ix86_expand_call (NULL, operands[0], operands[1], operands[2], operands[3]);
+ ix86_expand_call (NULL, operands[0], operands[1], operands[2], operands[3], 0);
DONE;
})
@@ -13412,7 +13684,17 @@
(use (match_operand 2 "" ""))]
""
{
- ix86_expand_call (NULL, operands[0], operands[1], operands[2], NULL);
+ ix86_expand_call (NULL, operands[0], operands[1], operands[2], NULL, 0);
+ DONE;
+})
+
+(define_expand "sibcall"
+ [(call (match_operand:QI 0 "" "")
+ (match_operand 1 "" ""))
+ (use (match_operand 2 "" ""))]
+ ""
+{
+ ix86_expand_call (NULL, operands[0], operands[1], operands[2], NULL, 1);
DONE;
})
@@ -13431,41 +13713,51 @@
(define_insn "*call_1"
[(call (mem:QI (match_operand:SI 0 "call_insn_operand" "rsm"))
(match_operand 1 "" ""))]
- "!TARGET_64BIT"
+ "!SIBLING_CALL_P (insn) && !TARGET_64BIT"
{
if (constant_call_address_operand (operands[0], QImode))
- {
- if (SIBLING_CALL_P (insn))
- return "jmp\t%P0";
- else
- return "call\t%P0";
- }
- if (SIBLING_CALL_P (insn))
- return "jmp\t%A0";
- else
- return "call\t%A0";
+ return "call\t%P0";
+ return "call\t%A0";
+}
+ [(set_attr "type" "call")])
+
+(define_insn "*sibcall_1"
+ [(call (mem:QI (match_operand:SI 0 "sibcall_insn_operand" "s,c,d,a"))
+ (match_operand 1 "" ""))]
+ "SIBLING_CALL_P (insn) && !TARGET_64BIT"
+{
+ if (constant_call_address_operand (operands[0], QImode))
+ return "jmp\t%P0";
+ return "jmp\t%A0";
}
[(set_attr "type" "call")])
(define_insn "*call_1_rex64"
[(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rsm"))
(match_operand 1 "" ""))]
- "TARGET_64BIT"
+ "!SIBLING_CALL_P (insn) && TARGET_64BIT"
{
if (constant_call_address_operand (operands[0], QImode))
- {
- if (SIBLING_CALL_P (insn))
- return "jmp\t%P0";
- else
- return "call\t%P0";
- }
- if (SIBLING_CALL_P (insn))
- return "jmp\t%A0";
- else
- return "call\t%A0";
+ return "call\t%P0";
+ return "call\t%A0";
}
[(set_attr "type" "call")])
+(define_insn "*sibcall_1_rex64"
+ [(call (mem:QI (match_operand:DI 0 "constant_call_address_operand" ""))
+ (match_operand 1 "" ""))]
+ "SIBLING_CALL_P (insn) && TARGET_64BIT"
+ "jmp\t%P0"
+ [(set_attr "type" "call")])
+
+(define_insn "*sibcall_1_rex64_v"
+ [(call (mem:QI (reg:DI 40))
+ (match_operand 0 "" ""))]
+ "SIBLING_CALL_P (insn) && TARGET_64BIT"
+ "jmp\t*%%r11"
+ [(set_attr "type" "call")])
+
+
;; Call subroutine, returning value in operand 0
(define_expand "call_value_pop"
@@ -13478,7 +13770,7 @@
"!TARGET_64BIT"
{
ix86_expand_call (operands[0], operands[1], operands[2],
- operands[3], operands[4]);
+ operands[3], operands[4], 0);
DONE;
})
@@ -13490,7 +13782,19 @@
;; Operand 2 not used on the i386.
""
{
- ix86_expand_call (operands[0], operands[1], operands[2], operands[3], NULL);
+ ix86_expand_call (operands[0], operands[1], operands[2], operands[3], NULL, 0);
+ DONE;
+})
+
+(define_expand "sibcall_value"
+ [(set (match_operand 0 "" "")
+ (call (match_operand:QI 1 "" "")
+ (match_operand:SI 2 "" "")))
+ (use (match_operand:SI 3 "" ""))]
+ ;; Operand 2 not used on the i386.
+ ""
+{
+ ix86_expand_call (operands[0], operands[1], operands[2], operands[3], NULL, 1);
DONE;
})
@@ -13513,7 +13817,7 @@
ix86_expand_call ((TARGET_FLOAT_RETURNS_IN_80387
? gen_rtx_REG (XCmode, FIRST_FLOAT_REG) : NULL),
operands[0], const0_rtx, GEN_INT (SSE_REGPARM_MAX - 1),
- NULL);
+ NULL, 0);
for (i = 0; i < XVECLEN (operands[2], 0); i++)
{
@@ -13662,11 +13966,7 @@
(clobber (mem:BLK (scratch)))]
"!TARGET_64BIT"
"leave"
- [(set_attr "length_immediate" "0")
- (set_attr "length" "1")
- (set_attr "modrm" "0")
- (set_attr "athlon_decode" "vector")
- (set_attr "ppro_uops" "few")])
+ [(set_attr "type" "leave")])
(define_insn "leave_rex64"
[(set (reg:DI 7) (plus:DI (reg:DI 6) (const_int 8)))
@@ -13674,11 +13974,7 @@
(clobber (mem:BLK (scratch)))]
"TARGET_64BIT"
"leave"
- [(set_attr "length_immediate" "0")
- (set_attr "length" "1")
- (set_attr "modrm" "0")
- (set_attr "athlon_decode" "vector")
- (set_attr "ppro_uops" "few")])
+ [(set_attr "type" "leave")])
(define_expand "ffssi2"
[(set (match_operand:SI 0 "nonimmediate_operand" "")
@@ -14312,6 +14608,24 @@
(const_string "fop")))
(set_attr "mode" "SF")])
+(define_insn "*fop_df_6"
+ [(set (match_operand:DF 0 "register_operand" "=f,f")
+ (match_operator:DF 3 "binary_fp_operator"
+ [(float_extend:DF
+ (match_operand:SF 1 "register_operand" "0,f"))
+ (float_extend:DF
+ (match_operand:SF 2 "nonimmediate_operand" "fm,0"))]))]
+ "TARGET_80387 && !(TARGET_SSE2 && TARGET_SSE_MATH)"
+ "* return output_387_binary_op (insn, operands);"
+ [(set (attr "type")
+ (cond [(match_operand:DF 3 "mult_operator" "")
+ (const_string "fmul")
+ (match_operand:DF 3 "div_operator" "")
+ (const_string "fdiv")
+ ]
+ (const_string "fop")))
+ (set_attr "mode" "SF")])
+
(define_insn "*fop_xf_1"
[(set (match_operand:XF 0 "register_operand" "=f,f")
(match_operator:XF 3 "binary_fp_operator"
@@ -14421,7 +14735,7 @@
(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:SF 1 "nonimmediate_operand" "fm,0"))
+ [(float_extend:XF (match_operand 1 "nonimmediate_operand" "fm,0"))
(match_operand:XF 2 "register_operand" "0,f")]))]
"!TARGET_64BIT && TARGET_80387"
"* return output_387_binary_op (insn, operands);"
@@ -14437,7 +14751,7 @@
(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:SF 1 "nonimmediate_operand" "fm,0"))
+ [(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);"
@@ -14455,7 +14769,7 @@
(match_operator:XF 3 "binary_fp_operator"
[(match_operand:XF 1 "register_operand" "0,f")
(float_extend:XF
- (match_operand:SF 2 "nonimmediate_operand" "fm,0"))]))]
+ (match_operand 2 "nonimmediate_operand" "fm,0"))]))]
"!TARGET_64BIT && TARGET_80387"
"* return output_387_binary_op (insn, operands);"
[(set (attr "type")
@@ -14472,7 +14786,7 @@
(match_operator:TF 3 "binary_fp_operator"
[(match_operand:TF 1 "register_operand" "0,f")
(float_extend:TF
- (match_operand:SF 2 "nonimmediate_operand" "fm,0"))]))]
+ (match_operand 2 "nonimmediate_operand" "fm,0"))]))]
"TARGET_80387"
"* return output_387_binary_op (insn, operands);"
[(set (attr "type")
@@ -14487,41 +14801,10 @@
(define_insn "*fop_xf_6"
[(set (match_operand:XF 0 "register_operand" "=f,f")
(match_operator:XF 3 "binary_fp_operator"
- [(float_extend:XF (match_operand:DF 1 "nonimmediate_operand" "fm,0"))
- (match_operand:XF 2 "register_operand" "0,f")]))]
- "!TARGET_64BIT && TARGET_80387"
- "* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:XF 3 "mult_operator" "")
- (const_string "fmul")
- (match_operand:XF 3 "div_operator" "")
- (const_string "fdiv")
- ]
- (const_string "fop")))
- (set_attr "mode" "DF")])
-
-(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:DF 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" "DF")])
-
-(define_insn "*fop_xf_7"
- [(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 1 "register_operand" "0,f"))
(float_extend:XF
- (match_operand:DF 2 "nonimmediate_operand" "fm,0"))]))]
+ (match_operand 2 "nonimmediate_operand" "fm,0"))]))]
"!TARGET_64BIT && TARGET_80387"
"* return output_387_binary_op (insn, operands);"
[(set (attr "type")
@@ -14531,14 +14814,15 @@
(const_string "fdiv")
]
(const_string "fop")))
- (set_attr "mode" "DF")])
+ (set_attr "mode" "SF")])
-(define_insn "*fop_tf_7"
+(define_insn "*fop_tf_6"
[(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 1 "register_operand" "0,f"))
(float_extend:TF
- (match_operand:DF 2 "nonimmediate_operand" "fm,0"))]))]
+ (match_operand 2 "nonimmediate_operand" "fm,0"))]))]
"TARGET_80387"
"* return output_387_binary_op (insn, operands);"
[(set (attr "type")
@@ -14548,7 +14832,7 @@
(const_string "fdiv")
]
(const_string "fop")))
- (set_attr "mode" "DF")])
+ (set_attr "mode" "SF")])
(define_split
[(set (match_operand 0 "register_operand" "")
@@ -15949,9 +16233,9 @@
(define_expand "movhicc"
[(set (match_operand:HI 0 "register_operand" "")
(if_then_else:HI (match_operand 1 "comparison_operator" "")
- (match_operand:HI 2 "nonimmediate_operand" "")
- (match_operand:HI 3 "nonimmediate_operand" "")))]
- "TARGET_CMOVE && TARGET_HIMODE_MATH"
+ (match_operand:HI 2 "general_operand" "")
+ (match_operand:HI 3 "general_operand" "")))]
+ "TARGET_HIMODE_MATH"
"if (!ix86_expand_int_movcc (operands)) FAIL; DONE;")
(define_insn "*movhicc_noc"
@@ -15968,6 +16252,33 @@
[(set_attr "type" "icmov")
(set_attr "mode" "HI")])
+(define_expand "movqicc"
+ [(set (match_operand:QI 0 "register_operand" "")
+ (if_then_else:QI (match_operand 1 "comparison_operator" "")
+ (match_operand:QI 2 "general_operand" "")
+ (match_operand:QI 3 "general_operand" "")))]
+ "TARGET_QIMODE_MATH"
+ "if (!ix86_expand_int_movcc (operands)) FAIL; DONE;")
+
+(define_insn_and_split "*movqicc_noc"
+ [(set (match_operand:QI 0 "register_operand" "=r,r")
+ (if_then_else:QI (match_operator 1 "ix86_comparison_operator"
+ [(match_operand 4 "flags_reg_operand" "") (const_int 0)])
+ (match_operand:QI 2 "register_operand" "r,0")
+ (match_operand:QI 3 "register_operand" "0,r")))]
+ "TARGET_CMOVE && !TARGET_PARTIAL_REG_STALL"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0)
+ (if_then_else:SI (match_op_dup 1 [(match_dup 4) (const_int 0)])
+ (match_dup 2)
+ (match_dup 3)))]
+ "operands[0] = gen_lowpart (SImode, operands[0]);
+ operands[2] = gen_lowpart (SImode, operands[2]);
+ operands[3] = gen_lowpart (SImode, operands[3]);"
+ [(set_attr "type" "icmov")
+ (set_attr "mode" "SI")])
+
(define_expand "movsfcc"
[(set (match_operand:SF 0 "register_operand" "")
(if_then_else:SF (match_operand 1 "comparison_operator" "")
@@ -16035,7 +16346,7 @@
(define_split
[(set (match_operand:DF 0 "register_and_not_any_fp_reg_operand" "")
(if_then_else:DF (match_operator 1 "fcmov_comparison_operator"
- [(match_operand 4 "" "") (const_int 0)])
+ [(match_operand 4 "flags_reg_operand" "") (const_int 0)])
(match_operand:DF 2 "nonimmediate_operand" "")
(match_operand:DF 3 "nonimmediate_operand" "")))]
"!TARGET_64BIT && reload_completed"
@@ -16549,6 +16860,12 @@
(clobber (reg:CC 17))]
"TARGET_SSE
&& (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)
+ /* Avoid combine from being smart and converting min/max
+ instruction patterns into conditional moves. */
+ && ((GET_CODE (operands[1]) != LT && GET_CODE (operands[1]) != GT
+ && GET_CODE (operands[1]) != UNLE && GET_CODE (operands[1]) != UNGE)
+ || !rtx_equal_p (operands[4], operands[2])
+ || !rtx_equal_p (operands[5], operands[3]))
&& (!TARGET_IEEE_FP
|| (GET_CODE (operands[1]) != EQ && GET_CODE (operands[1]) != NE))"
"#")
@@ -16576,6 +16893,12 @@
(clobber (reg:CC 17))]
"TARGET_SSE2
&& (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)
+ /* Avoid combine from being smart and converting min/max
+ instruction patterns into conditional moves. */
+ && ((GET_CODE (operands[1]) != LT && GET_CODE (operands[1]) != GT
+ && GET_CODE (operands[1]) != UNLE && GET_CODE (operands[1]) != UNGE)
+ || !rtx_equal_p (operands[4], operands[2])
+ || !rtx_equal_p (operands[5], operands[3]))
&& (!TARGET_IEEE_FP
|| (GET_CODE (operands[1]) != EQ && GET_CODE (operands[1]) != NE))"
"#")
@@ -16637,6 +16960,14 @@
(set (subreg:TI (match_dup 0) 0) (ior:TI (subreg:TI (match_dup 6) 0)
(subreg:TI (match_dup 7) 0)))]
{
+ if (GET_MODE (operands[2]) == DFmode
+ && TARGET_SSE_PARTIAL_REGS && !optimize_size)
+ {
+ rtx op = simplify_gen_subreg (V2DFmode, operands[2], DFmode, 0);
+ emit_insn (gen_sse2_unpcklpd (op, op, op));
+ op = simplify_gen_subreg (V2DFmode, operands[3], DFmode, 0);
+ emit_insn (gen_sse2_unpcklpd (op, op, op));
+ }
/* If op2 == op3, op3 will be clobbered before it is used.
This should be optimized out though. */
if (operands_match_p (operands[2], operands[3]))
@@ -16743,8 +17074,22 @@
|| const0_operand (operands[3], GET_MODE (operands[0])))"
[(set (match_dup 0) (match_op_dup 1 [(match_dup 0) (match_dup 5)]))
(set (subreg:TI (match_dup 0) 0) (and:TI (match_dup 6)
- (subreg:TI (match_dup 7) 0)))]
+ (match_dup 7)))]
{
+ if (TARGET_SSE_PARTIAL_REGS && !optimize_size
+ && GET_MODE (operands[2]) == DFmode)
+ {
+ if (REG_P (operands[2]))
+ {
+ rtx op = simplify_gen_subreg (V2DFmode, operands[2], DFmode, 0);
+ emit_insn (gen_sse2_unpcklpd (op, op, op));
+ }
+ if (REG_P (operands[3]))
+ {
+ rtx op = simplify_gen_subreg (V2DFmode, operands[3], DFmode, 0);
+ emit_insn (gen_sse2_unpcklpd (op, op, op));
+ }
+ }
PUT_MODE (operands[1], GET_MODE (operands[0]));
if (!sse_comparison_operator (operands[1], VOIDmode))
{
@@ -16764,6 +17109,8 @@
operands[7] = operands[2];
operands[6] = gen_rtx_SUBREG (TImode, operands[0], 0);
}
+ operands[7] = simplify_gen_subreg (TImode, operands[7],
+ GET_MODE (operands[7]), 0);
})
(define_expand "allocate_stack_worker"
@@ -17759,19 +18106,23 @@
[(set (match_operand 0 "" "")
(call (mem:QI (match_operand:SI 1 "call_insn_operand" "rsm"))
(match_operand:SI 2 "" "")))]
- "!TARGET_64BIT"
+ "!SIBLING_CALL_P (insn) && !TARGET_64BIT"
{
if (constant_call_address_operand (operands[1], QImode))
- {
- if (SIBLING_CALL_P (insn))
- return "jmp\t%P1";
- else
- return "call\t%P1";
- }
- if (SIBLING_CALL_P (insn))
- return "jmp\t%*%1";
- else
- return "call\t%*%1";
+ return "call\t%P1";
+ return "call\t%*%1";
+}
+ [(set_attr "type" "callv")])
+
+(define_insn "*sibcall_value_1"
+ [(set (match_operand 0 "" "")
+ (call (mem:QI (match_operand:SI 1 "sibcall_insn_operand" "s,c,d,a"))
+ (match_operand:SI 2 "" "")))]
+ "SIBLING_CALL_P (insn) && !TARGET_64BIT"
+{
+ if (constant_call_address_operand (operands[1], QImode))
+ return "jmp\t%P1";
+ return "jmp\t%*%1";
}
[(set_attr "type" "callv")])
@@ -17779,21 +18130,29 @@
[(set (match_operand 0 "" "")
(call (mem:QI (match_operand:DI 1 "call_insn_operand" "rsm"))
(match_operand:DI 2 "" "")))]
- "TARGET_64BIT"
+ "!SIBLING_CALL_P (insn) && TARGET_64BIT"
{
if (constant_call_address_operand (operands[1], QImode))
- {
- if (SIBLING_CALL_P (insn))
- return "jmp\t%P1";
- else
- return "call\t%P1";
- }
- if (SIBLING_CALL_P (insn))
- return "jmp\t%A1";
- else
- return "call\t%A1";
+ return "call\t%P1";
+ return "call\t%A1";
}
[(set_attr "type" "callv")])
+
+(define_insn "*sibcall_value_1_rex64"
+ [(set (match_operand 0 "" "")
+ (call (mem:QI (match_operand:DI 1 "constant_call_address_operand" ""))
+ (match_operand:DI 2 "" "")))]
+ "SIBLING_CALL_P (insn) && TARGET_64BIT"
+ "jmp\t%P1"
+ [(set_attr "type" "callv")])
+
+(define_insn "*sibcall_value_1_rex64_v"
+ [(set (match_operand 0 "" "")
+ (call (mem:QI (reg:DI 40))
+ (match_operand:DI 1 "" "")))]
+ "SIBLING_CALL_P (insn) && TARGET_64BIT"
+ "jmp\t*%%r11"
+ [(set_attr "type" "callv")])
(define_insn "trap"
[(trap_if (const_int 1) (const_int 5))]
@@ -17838,7 +18197,7 @@
{
operands[2] = gen_label_rtx ();
output_asm_insn ("j%c0\t%l2\; int\t%1", operands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (operands[2]));
RET;
})
@@ -17851,28 +18210,93 @@
[(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,m")
(match_operand:V4SF 1 "nonimmediate_operand" "xm,x"))]
"TARGET_SSE"
- ;; @@@ let's try to use movaps here.
"movaps\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "mode" "V4SF")])
+(define_split
+ [(set (match_operand:V4SF 0 "register_operand" "")
+ (match_operand:V4SF 1 "zero_extended_scalar_load_operand" ""))]
+ "TARGET_SSE"
+ [(set (match_dup 0)
+ (vec_merge:V4SF
+ (vec_duplicate:V4SF (match_dup 1))
+ (match_dup 2)
+ (const_int 1)))]
+{
+ operands[1] = simplify_gen_subreg (SFmode, operands[1], V4SFmode, 0);
+ operands[2] = CONST0_RTX (V4SFmode);
+})
+
(define_insn "movv4si_internal"
[(set (match_operand:V4SI 0 "nonimmediate_operand" "=x,m")
(match_operand:V4SI 1 "nonimmediate_operand" "xm,x"))]
"TARGET_SSE"
- ;; @@@ let's try to use movaps here.
- "movaps\t{%1, %0|%0, %1}"
+{
+ if (get_attr_mode (insn) == MODE_V4SF)
+ return "movaps\t{%1, %0|%0, %1}";
+ else
+ return "movdqa\t{%1, %0|%0, %1}";
+}
[(set_attr "type" "ssemov")
- (set_attr "mode" "V4SF")])
+ (set (attr "mode")
+ (cond [(eq_attr "alternative" "0")
+ (if_then_else
+ (ne (symbol_ref "optimize_size")
+ (const_int 0))
+ (const_string "V4SF")
+ (const_string "TI"))
+ (eq_attr "alternative" "1")
+ (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 "TI")))])
(define_insn "movv2di_internal"
[(set (match_operand:V2DI 0 "nonimmediate_operand" "=x,m")
(match_operand:V2DI 1 "nonimmediate_operand" "xm,x"))]
- "TARGET_SSE"
- ;; @@@ let's try to use movaps here.
- "movdqa\t{%1, %0|%0, %1}"
+ "TARGET_SSE2"
+{
+ if (get_attr_mode (insn) == MODE_V4SF)
+ return "movaps\t{%1, %0|%0, %1}";
+ else
+ return "movdqa\t{%1, %0|%0, %1}";
+}
[(set_attr "type" "ssemov")
- (set_attr "mode" "V4SF")])
+ (set (attr "mode")
+ (cond [(eq_attr "alternative" "0")
+ (if_then_else
+ (ne (symbol_ref "optimize_size")
+ (const_int 0))
+ (const_string "V4SF")
+ (const_string "TI"))
+ (eq_attr "alternative" "1")
+ (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 "TI")))])
+
+(define_split
+ [(set (match_operand:V2DF 0 "register_operand" "")
+ (match_operand:V2DF 1 "zero_extended_scalar_load_operand" ""))]
+ "TARGET_SSE2"
+ [(set (match_dup 0)
+ (vec_merge:V2DF
+ (vec_duplicate:V2DF (match_dup 1))
+ (match_dup 2)
+ (const_int 1)))]
+{
+ operands[1] = simplify_gen_subreg (DFmode, operands[1], V2DFmode, 0);
+ operands[2] = CONST0_RTX (V2DFmode);
+})
(define_insn "movv8qi_internal"
[(set (match_operand:V8QI 0 "nonimmediate_operand" "=y,m")
@@ -17922,28 +18346,85 @@
[(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,m")
(match_operand:V2DF 1 "nonimmediate_operand" "xm,x"))]
"TARGET_SSE2"
- ;; @@@ let's try to use movaps here.
- "movapd\t{%1, %0|%0, %1}"
+{
+ if (get_attr_mode (insn) == MODE_V4SF)
+ return "movaps\t{%1, %0|%0, %1}";
+ else
+ return "movapd\t{%1, %0|%0, %1}";
+}
[(set_attr "type" "ssemov")
- (set_attr "mode" "V2DF")])
+ (set (attr "mode")
+ (cond [(eq_attr "alternative" "0")
+ (if_then_else
+ (ne (symbol_ref "optimize_size")
+ (const_int 0))
+ (const_string "V4SF")
+ (const_string "V2DF"))
+ (eq_attr "alternative" "1")
+ (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 "V2DF"))]
+ (const_string "V2DF")))])
(define_insn "movv8hi_internal"
[(set (match_operand:V8HI 0 "nonimmediate_operand" "=x,m")
(match_operand:V8HI 1 "nonimmediate_operand" "xm,x"))]
"TARGET_SSE2"
- ;; @@@ let's try to use movaps here.
- "movaps\t{%1, %0|%0, %1}"
+{
+ if (get_attr_mode (insn) == MODE_V4SF)
+ return "movaps\t{%1, %0|%0, %1}";
+ else
+ return "movdqa\t{%1, %0|%0, %1}";
+}
[(set_attr "type" "ssemov")
- (set_attr "mode" "V4SF")])
+ (set (attr "mode")
+ (cond [(eq_attr "alternative" "0")
+ (if_then_else
+ (ne (symbol_ref "optimize_size")
+ (const_int 0))
+ (const_string "V4SF")
+ (const_string "TI"))
+ (eq_attr "alternative" "1")
+ (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 "TI")))])
(define_insn "movv16qi_internal"
[(set (match_operand:V16QI 0 "nonimmediate_operand" "=x,m")
(match_operand:V16QI 1 "nonimmediate_operand" "xm,x"))]
"TARGET_SSE2"
- ;; @@@ let's try to use movaps here.
- "movaps\t{%1, %0|%0, %1}"
+{
+ if (get_attr_mode (insn) == MODE_V4SF)
+ return "movaps\t{%1, %0|%0, %1}";
+ else
+ return "movdqa\t{%1, %0|%0, %1}";
+}
[(set_attr "type" "ssemov")
- (set_attr "mode" "V4SF")])
+ (set (attr "mode")
+ (cond [(eq_attr "alternative" "0")
+ (if_then_else
+ (ne (symbol_ref "optimize_size")
+ (const_int 0))
+ (const_string "V4SF")
+ (const_string "TI"))
+ (eq_attr "alternative" "1")
+ (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 "TI")))])
(define_expand "movv2df"
[(set (match_operand:V2DF 0 "general_operand" "")
@@ -18160,26 +18641,83 @@
[(set (match_operand:TI 0 "nonimmediate_operand" "=x,x,m")
(match_operand:TI 1 "general_operand" "C,xm,x"))]
"TARGET_SSE && !TARGET_64BIT"
- "@
- xorps\t%0, %0
- movaps\t{%1, %0|%0, %1}
- movaps\t{%1, %0|%0, %1}"
+{
+ switch (which_alternative)
+ {
+ case 0:
+ if (get_attr_mode (insn) == MODE_V4SF)
+ return "xorps\t%0, %0";
+ else
+ return "pxor\t%0, %0";
+ case 1:
+ case 2:
+ 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" "V4SF")])
+ (set (attr "mode")
+ (cond [(eq_attr "alternative" "0,1")
+ (if_then_else
+ (ne (symbol_ref "optimize_size")
+ (const_int 0))
+ (const_string "V4SF")
+ (const_string "TI"))
+ (eq_attr "alternative" "2")
+ (if_then_else
+ (ne (symbol_ref "optimize_size")
+ (const_int 0))
+ (const_string "V4SF")
+ (const_string "TI"))]
+ (const_string "TI")))])
(define_insn "*movti_rex64"
- [(set (match_operand:TI 0 "nonimmediate_operand" "=r,o,x,mx,x")
- (match_operand:TI 1 "general_operand" "riFo,riF,O,x,m"))]
+ [(set (match_operand:TI 0 "nonimmediate_operand" "=r,o,x,x,xm")
+ (match_operand:TI 1 "general_operand" "riFo,riF,O,xm,x"))]
"TARGET_64BIT
&& (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)"
- "@
- #
- #
- xorps\t%0, %0
- movaps\\t{%1, %0|%0, %1}
- movaps\\t{%1, %0|%0, %1}"
+{
+ 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" "V4SF")])
+ (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" "")
@@ -18329,11 +18867,21 @@
[(set_attr "type" "ssecvt")
(set_attr "mode" "V4SF")])
-(define_insn "sse_loadss"
+(define_expand "sse_loadss"
+ [(match_operand:V4SF 0 "register_operand" "")
+ (match_operand:SF 1 "memory_operand" "")]
+ "TARGET_SSE"
+{
+ emit_insn (gen_sse_loadss_1 (operands[0], operands[1],
+ CONST0_RTX (V4SFmode)));
+ DONE;
+})
+
+(define_insn "sse_loadss_1"
[(set (match_operand:V4SF 0 "register_operand" "=x")
(vec_merge:V4SF
- (match_operand:V4SF 1 "memory_operand" "m")
- (vec_duplicate:V4SF (float:SF (const_int 0)))
+ (vec_duplicate:V4SF (match_operand:SF 1 "memory_operand" "m"))
+ (match_operand:V4SF 2 "const0_operand" "X")
(const_int 1)))]
"TARGET_SSE"
"movss\t{%1, %0|%0, %1}"
@@ -18856,12 +19404,26 @@
;; this insn.
(define_insn "sse_clrv4sf"
[(set (match_operand:V4SF 0 "register_operand" "=x")
- (unspec:V4SF [(const_int 0)] UNSPEC_NOP))]
+ (match_operand:V4SF 1 "const0_operand" "X"))]
"TARGET_SSE"
- "xorps\t{%0, %0|%0, %0}"
+{
+ if (get_attr_mode (insn) == MODE_TI)
+ return "pxor\t{%0, %0|%0, %0}";
+ else
+ return "xorps\t{%0, %0|%0, %0}";
+}
[(set_attr "type" "sselog")
(set_attr "memory" "none")
- (set_attr "mode" "V4SF")])
+ (set (attr "mode")
+ (if_then_else
+ (and (and (ne (symbol_ref "TARGET_SSE_LOAD0_BY_PXOR")
+ (const_int 0))
+ (ne (symbol_ref "TARGET_SSE2")
+ (const_int 0)))
+ (eq (symbol_ref "optimize_size")
+ (const_int 0)))
+ (const_string "TI")
+ (const_string "V4SF")))])
;; Use xor, but don't show input operands so they aren't live before
;; this insn.
@@ -19093,6 +19655,18 @@
[(set_attr "type" "ssecvt")
(set_attr "mode" "SF")])
+(define_insn "cvtsi2ssq"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (vec_merge:V4SF
+ (match_operand:V4SF 1 "register_operand" "0")
+ (vec_duplicate:V4SF
+ (float:SF (match_operand:DI 2 "nonimmediate_operand" "rm")))
+ (const_int 14)))]
+ "TARGET_SSE && TARGET_64BIT"
+ "cvtsi2ssq\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "mode" "SF")])
+
(define_insn "cvtss2si"
[(set (match_operand:SI 0 "register_operand" "=r")
(vec_select:SI
@@ -19883,7 +20457,7 @@
output_asm_insn (\"rex\", operands);
output_asm_insn (\"movaps\\t{%5, %4|%4, %5}\", operands);
}
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (operands[3]));
RET;
}
@@ -20720,7 +21294,7 @@
(vec_merge:V4SF (match_operand:V4SF 1 "register_operand" "0")
(vec_duplicate:V4SF
(float_truncate:V2SF
- (match_operand:V2DF 2 "register_operand" "xm")))
+ (match_operand:V2DF 2 "nonimmediate_operand" "xm")))
(const_int 14)))]
"TARGET_SSE2"
"cvtsd2ss\t{%2, %0|%0, %2}"
@@ -20732,7 +21306,7 @@
(vec_merge:V2DF (match_operand:V2DF 1 "register_operand" "0")
(float_extend:V2DF
(vec_select:V2SF
- (match_operand:V4SF 2 "register_operand" "xm")
+ (match_operand:V4SF 2 "nonimmediate_operand" "xm")
(parallel [(const_int 0)
(const_int 1)])))
(const_int 2)))]
@@ -21008,10 +21582,20 @@
(define_insn "sse2_clrti"
[(set (match_operand:TI 0 "register_operand" "=x") (const_int 0))]
"TARGET_SSE2"
- "pxor\t{%0, %0|%0, %0}"
- [(set_attr "type" "sseiadd")
+{
+ if (get_attr_mode (insn) == MODE_TI)
+ return "pxor\t%0, %0";
+ else
+ return "xorps\t%0, %0";
+}
+ [(set_attr "type" "ssemov")
(set_attr "memory" "none")
- (set_attr "mode" "TI")])
+ (set (attr "mode")
+ (if_then_else
+ (ne (symbol_ref "optimize_size")
+ (const_int 0))
+ (const_string "V4SF")
+ (const_string "TI")))])
;; MMX unsigned averages/sum of absolute differences
@@ -21716,11 +22300,21 @@
[(set_attr "type" "ssecvt")
(set_attr "mode" "V2DF")])
-(define_insn "sse2_loadsd"
+(define_expand "sse2_loadsd"
+ [(match_operand:V2DF 0 "register_operand" "")
+ (match_operand:DF 1 "memory_operand" "")]
+ "TARGET_SSE2"
+{
+ emit_insn (gen_sse2_loadsd_1 (operands[0], operands[1],
+ CONST0_RTX (V2DFmode)));
+ DONE;
+})
+
+(define_insn "sse2_loadsd_1"
[(set (match_operand:V2DF 0 "register_operand" "=x")
(vec_merge:V2DF
- (match_operand:DF 1 "memory_operand" "m")
- (vec_duplicate:DF (float:DF (const_int 0)))
+ (vec_duplicate:V2DF (match_operand:DF 1 "memory_operand" "m"))
+ (match_operand:V2DF 2 "const0_operand" "X")
(const_int 1)))]
"TARGET_SSE2"
"movsd\t{%1, %0|%0, %1}"
diff --git a/gcc/config/i386/k6.md b/gcc/config/i386/k6.md
index af128bfe037..d9f6d84b022 100644
--- a/gcc/config/i386/k6.md
+++ b/gcc/config/i386/k6.md
@@ -71,7 +71,7 @@
;; Load unit have two cycle latency, but we take care for it in adjust_cost
(define_function_unit "k6_load" 1 0
(and (eq_attr "cpu" "k6")
- (ior (eq_attr "type" "pop")
+ (ior (eq_attr "type" "pop,leave")
(eq_attr "memory" "load,both")))
1 1)
diff --git a/gcc/config/i386/lynx-ng.h b/gcc/config/i386/lynx-ng.h
index 08fa60f430c..8d41add6cee 100644
--- a/gcc/config/i386/lynx-ng.h
+++ b/gcc/config/i386/lynx-ng.h
@@ -68,10 +68,3 @@ Boston, MA 02111-1307, USA. */
#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \
sprintf ((BUF), ".%s%ld", (PREFIX), (long)(NUMBER))
-
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
diff --git a/gcc/config/i386/lynx.h b/gcc/config/i386/lynx.h
index 7835f2713f2..bdbfbe65f0f 100644
--- a/gcc/config/i386/lynx.h
+++ b/gcc/config/i386/lynx.h
@@ -69,10 +69,3 @@ Boston, MA 02111-1307, USA. */
#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \
sprintf ((BUF), ".%s%ld", (PREFIX), (long)(NUMBER))
-
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
diff --git a/gcc/config/i386/pentium.md b/gcc/config/i386/pentium.md
index b4c5ece3678..24f8becb02a 100644
--- a/gcc/config/i386/pentium.md
+++ b/gcc/config/i386/pentium.md
@@ -194,7 +194,7 @@
(define_insn_reservation "pent_pop" 1
(and (eq_attr "cpu" "pentium")
- (eq_attr "type" "pop"))
+ (eq_attr "type" "pop,leave"))
"pentium-firstuv")
;; Call and branch instruction can execute in either pipe, but
diff --git a/gcc/config/i386/ppro.md b/gcc/config/i386/ppro.md
index 86906856469..67cc1f1e293 100644
--- a/gcc/config/i386/ppro.md
+++ b/gcc/config/i386/ppro.md
@@ -29,7 +29,7 @@
(define_attr "ppro_uops" "one,few,many"
(cond [(eq_attr "type" "other,multi,call,callv,fpspc,str")
(const_string "many")
- (eq_attr "type" "icmov,fcmov,str,cld")
+ (eq_attr "type" "icmov,fcmov,str,cld,leave")
(const_string "few")
(eq_attr "type" "imov")
(if_then_else (eq_attr "memory" "store,both")
@@ -118,7 +118,7 @@
(define_function_unit "ppro_p2" 1 0
(and (eq_attr "cpu" "pentiumpro")
- (ior (eq_attr "type" "pop")
+ (ior (eq_attr "type" "pop,leave")
(eq_attr "memory" "load,both")))
3 1)
diff --git a/gcc/config/i386/sco5.h b/gcc/config/i386/sco5.h
index 815e45771d6..3b25b65d826 100644
--- a/gcc/config/i386/sco5.h
+++ b/gcc/config/i386/sco5.h
@@ -343,7 +343,7 @@ do { \
do { \
if (TARGET_ELF) \
ASM_OUTPUT_ALIGN ((FILE), 2); \
- ASM_OUTPUT_INTERNAL_LABEL((FILE),(PREFIX),(NUM)); \
+ (*targetm.asm_out.internal_label)((FILE),(PREFIX),(NUM)); \
} while (0)
#undef ASM_OUTPUT_IDENT
@@ -354,10 +354,6 @@ do { \
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
if (TARGET_ELF) (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0))
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
-
/* The prefix to add to user-visible assembler symbols. */
#undef USER_LABEL_PREFIX
diff --git a/gcc/config/i386/t-cygwin b/gcc/config/i386/t-cygwin
index 6fcb8340ddc..b4ea698cbc2 100644
--- a/gcc/config/i386/t-cygwin
+++ b/gcc/config/i386/t-cygwin
@@ -14,7 +14,9 @@ LIBGCC2_INCLUDES = -I$(srcdir)/../winsup/include \
-I$(srcdir)/../winsup/cygwin/include \
-I$(srcdir)/../winsup/w32api/include
-winnt.o: $(srcdir)/config/i386/winnt.c $(RTL_H) $(TREE_H) $(CONFIG_H) $(TM_P_H)
+winnt.o: $(srcdir)/config/i386/winnt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \
+ $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i386/winnt.c
# Don't run fixproto
diff --git a/gcc/config/i386/t-interix b/gcc/config/i386/t-interix
index 710de8b0881..d5fff6167b7 100644
--- a/gcc/config/i386/t-interix
+++ b/gcc/config/i386/t-interix
@@ -1,6 +1,7 @@
LIB1ASMSRC = i386/cygwin.asm
LIB1ASMFUNCS = _chkstk
-winnt.o: $(srcdir)/config/i386/winnt.c $(TM_P_H)
+winnt.o: $(srcdir)/config/i386/winnt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \
+ $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i386/winnt.c
-
diff --git a/gcc/config/i386/vxi386.h b/gcc/config/i386/vxi386.h
deleted file mode 100644
index ee4a74093f8..00000000000
--- a/gcc/config/i386/vxi386.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Definitions of target machine for GNU compiler. VxWorks i386 version.
- Copyright (C) 1998, 2002 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. */
-
-#undef TARGET_VERSION
-#define TARGET_VERSION fprintf (stderr, " (80386, VxWorks BSD syntax)");
-
-#define TARGET_OS_CPP_BUILTINS() \
- do \
- { \
- builtin_define ("__vxworks"); \
- builtin_assert ("system=unix"); \
- \
- if (TARGET_386) \
- builtin_define ("CPU=I80386"); \
- else if (TARGET_486) \
- builtin_define ("CPU=I80486"); \
- else if (TARGET_PENTIUM) \
- { \
- builtin_define ("CPU=PENTIUM"); \
- builtin_define ("CPU_VARIANT=PENTIUM"); \
- } \
- else if (TARGET_PENTIUMPRO) \
- { \
- builtin_define ("CPU=PENTIUM"); \
- builtin_define ("CPU_VARIANT=PENTIUMPRO"); \
- } \
- } \
- while (0)
-
-#define HANDLE_SYSV_PRAGMA 1
-
-/* VxWorks does all the library stuff itself. */
-
-#undef LIB_SPEC
-#define LIB_SPEC ""
-
-/* VxWorks uses object files, not loadable images. make linker just
- combine objects. */
-
-#undef LINK_SPEC
-#define LINK_SPEC "-r"
-
-/* VxWorks provides the functionality of crt0.o and friends itself. */
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC ""
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC ""
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index 00b3dfd0442..bc2527aaca5 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -22,6 +22,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
diff --git a/gcc/config/i386/xm-i386-interix.h b/gcc/config/i386/xm-i386-interix.h
deleted file mode 100644
index bd010e47bc5..00000000000
--- a/gcc/config/i386/xm-i386-interix.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Configuration for GNU compiler
- for an Intel i386 or later processor running Interix.
- Copyright (C) 1999 Free Software Foundation, Inc.
- Contributed by Donn Terry (donn@interix.com)
- Derived from code by Douglas B. Rupp (drupp@cs.washington.edu)
-
-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 HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_LONGLONG
-#ifdef __GNUC__
-# define HOST_WIDEST_INT long long
-#else
-# define HOST_WIDEST_INT __int64
-#endif
-#define HOST_WIDEST_INT_PRINT_DEC "%lld"
-#define HOST_WIDEST_INT_PRINT_UNSIGNED "%llu"
-#define HOST_WIDEST_INT_PRINT_HEX "0x%llx"
diff --git a/gcc/config/i960/i960-c.c b/gcc/config/i960/i960-c.c
index b6a9b749d0c..781224a0e52 100644
--- a/gcc/config/i960/i960-c.c
+++ b/gcc/config/i960/i960-c.c
@@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "cpplib.h"
#include "tree.h"
#include "c-pragma.h"
diff --git a/gcc/config/i960/i960.c b/gcc/config/i960/i960.c
index 102729e444b..08894aa46b1 100644
--- a/gcc/config/i960/i960.c
+++ b/gcc/config/i960/i960.c
@@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include <math.h>
#include "rtl.h"
#include "regs.h"
diff --git a/gcc/config/i960/i960.h b/gcc/config/i960/i960.h
index 9af2964fbbb..3ce98e23011 100644
--- a/gcc/config/i960/i960.h
+++ b/gcc/config/i960/i960.h
@@ -931,12 +931,6 @@ struct cum_args { int ca_nregparms; int ca_nstackparms; };
/* Addressing modes, and classification of registers for them. */
-/* #define HAVE_POST_INCREMENT 0 */
-/* #define HAVE_POST_DECREMENT 0 */
-
-/* #define HAVE_PRE_DECREMENT 0 */
-/* #define HAVE_PRE_INCREMENT 0 */
-
/* Macros to check register numbers against specific register classes. */
/* These assume that REGNO is a hard or pseudo reg number.
@@ -1259,12 +1253,6 @@ extern struct rtx_def *i960_compare_op0, *i960_compare_op1;
#define USER_LABEL_PREFIX "_"
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, "%s%d:\n", PREFIX, NUM)
-
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
@@ -1350,13 +1338,6 @@ extern struct rtx_def *i960_compare_op0, *i960_compare_op1;
#define LABEL_ALIGN_AFTER_BARRIER(LABEL) (TARGET_CODE_ALIGN ? 3 : 0)
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
- ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
/* Print operand X (an rtx) in assembler syntax to file FILE.
CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
diff --git a/gcc/config/i960/t-960bare b/gcc/config/i960/t-960bare
index 7c243643cb0..e335294f11b 100644
--- a/gcc/config/i960/t-960bare
+++ b/gcc/config/i960/t-960bare
@@ -18,9 +18,9 @@ xp-bit.c: $(srcdir)/config/fp-bit.c
echo '#define EXTENDED_FLOAT_STUBS' > xp-bit.c
cat $(srcdir)/config/fp-bit.c >> xp-bit.c
-i960-c.o: $(srcdir)/config/i960/i960-c.c $(CONFIG_H) $(SYSTEM_H) cpplib.h \
- $(TREE_H) c-pragma.h toplev.h $(GGC_H) $(TM_P_H)
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+i960-c.o: $(srcdir)/config/i960/i960-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h
+ $(TM_H) $(CPPLIB_H) $(TREE_H) c-pragma.h toplev.h $(GGC_H) $(TM_P_H)
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i960/i960-c.c
MULTILIB_OPTIONS=mnumerics/msoft-float mlong-double-64
MULTILIB_DIRNAMES=float soft-float ld64
diff --git a/gcc/config/i960/t-vxworks960 b/gcc/config/i960/t-vxworks960
deleted file mode 100644
index 0c5f40fdbf5..00000000000
--- a/gcc/config/i960/t-vxworks960
+++ /dev/null
@@ -1,33 +0,0 @@
-# We don't want to put exit in libgcc.a for VxWorks, because VxWorks
-# does not have _exit.
-TARGET_LIBGCC2_CFLAGS = -Dexit=unused_exit
-LIB2FUNCS_EXTRA = xp-bit.c
-
-# We want fine grained libraries, so use the new code to build the
-# floating point emulation libraries.
-FPBIT = fp-bit.c
-DPBIT = dp-bit.c
-
-dp-bit.c: $(srcdir)/config/fp-bit.c
- echo '#define FLOAT_BIT_ORDER_MISMATCH' > dp-bit.c
- cat $(srcdir)/config/fp-bit.c >> dp-bit.c
-
-fp-bit.c: $(srcdir)/config/fp-bit.c
- echo '#define FLOAT' > fp-bit.c
- echo '#define FLOAT_BIT_ORDER_MISMATCH' >> fp-bit.c
- cat $(srcdir)/config/fp-bit.c >> fp-bit.c
-
-xp-bit.c: $(srcdir)/config/fp-bit.c
- echo '#define EXTENDED_FLOAT_STUBS' > xp-bit.c
- cat $(srcdir)/config/fp-bit.c >> xp-bit.c
-
-i960-c.o: $(srcdir)/config/i960/i960-c.c $(CONFIG_H) $(SYSTEM_H) cpplib.h \
- $(TREE_H) c-pragma.h toplev.h $(GGC_H) $(TM_P_H)
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
-
-MULTILIB_OPTIONS=mnumerics/msoft-float mlong-double-64
-MULTILIB_DIRNAMES=float soft-float ld64
-MULTILIB_MATCHES=mnumerics=msb mnumerics=msc mnumerics=mkb mnumerics=mkc mnumerics=mmc mnumerics=mcb mnumerics=mcc msoft-float=msa msoft-float=mka msoft-float=mca msoft-float=mcf
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/i960/vx960-coff.h b/gcc/config/i960/vx960-coff.h
deleted file mode 100644
index 76352582671..00000000000
--- a/gcc/config/i960/vx960-coff.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Definitions of target machine for GNU compiler. Vxworks i960 version.
- Copyright (C) 1994, 1995, 1996 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. */
-
-/* This file just exists to give specs for the 960 running on VxWorks.
- VxWorks does all the library stuff itself. */
-
-#undef MULTILIB_DEFAULTS
-#define MULTILIB_DEFAULTS { "msoft-float" }
-
-#undef LIB_SPEC
-#define LIB_SPEC ""
-
-/* VxWorks provides the functionality of crt0.o and friends itself. */
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC ""
-
-/* Predefine vxworks. */
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Di960 -Di80960 -DI960 -DI80960 -Dvxworks -Acpu=i960 -Amachine=i960"
-
-/* The VxWorks header files expect the compiler to define CPU to a
- magic number. Note that we define CPU here even if the user
- has specified -ansi. This violates user namespace, but the VxWorks
- headers, and potentially user code, all explicitly rely upon the
- definition of CPU in order to get the proper processor information. */
-
-#undef CPP_SPEC
-#define CPP_SPEC "%{mic*:-D__i960\
- %{mka:-D__i960KA}%{mkb:-D__i960KB}\
- %{msa:-D__i960SA}%{msb:-D__i960SB}\
- %{mmc:-D__i960MC}\
- %{mca:-D__i960CA}%{mcc:-D__i960CC}\
- %{mcf:-D__i960CF}}\
- %{mka:-D__i960KA__ -D__i960_KA__ -DCPU=I960KA}\
- %{mkb:-D__i960KB__ -D__i960_KB__ -DCPU=I960KB}\
- %{msa:-D__i960SA__ -D__i960_SA__}\
- %{msb:-D__i960SB__ -D__i960_SB__}\
- %{mmc:-D__i960MC__ -D__i960_MC__}\
- %{mca:-D__i960CA__ -D__i960_CA__ -DCPU=I960CA}\
- %{mcc:-D__i960CC__ -D__i960_CC__}\
- %{mcf:-D__i960CF__ -D__i960_CF__}\
- %{!mka:%{!mkb:%{!msa:%{!msb:%{!mmc:%{!mca:\
- %{!mcc:%{!mcf:-D__i960_CA -D__i960CA__ -DCPU=I960CA\
- %{mic*:-D__i960CA}}}}}}}}}\
- %{mlong-double-64:-D__LONG_DOUBLE_64__}"
-
-/* Default to -mca. */
-
-#undef CC1_SPEC
-#define CC1_SPEC \
- "%{!mka:%{!mkb:%{!msa:%{!msb:%{!mmc:%{!mca:%{!mcc:%{!mcf:-mca}}}}}}}}\
- %{!gs*:%{!gc*:%{mbout:%{g*:-gstabs}}\
- %{mcoff:%{g*:-gcoff}}\
- %{!mbout:%{!mcoff:%{g*:-gcoff}}}}}"
diff --git a/gcc/config/i960/vx960.h b/gcc/config/i960/vx960.h
deleted file mode 100644
index ebf70dc183a..00000000000
--- a/gcc/config/i960/vx960.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Definitions of target machine for GNU compiler. Vxworks i960 version.
- Copyright (C) 1994, 1996 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. */
-
-/* This file just exists to give specs for the 960 running on VxWorks.
- VxWorks does all the library stuff itself. */
-
-#undef LIB_SPEC
-#define LIB_SPEC ""
-
-/* VxWorks provides the functionality of crt0.o and friends itself. */
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC ""
diff --git a/gcc/config/ia64/ia64-c.c b/gcc/config/ia64/ia64-c.c
index c19a5860532..efd3a9a1efc 100644
--- a/gcc/config/ia64/ia64-c.c
+++ b/gcc/config/ia64/ia64-c.c
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "cpplib.h"
#include "c-common.h"
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 10f06665999..dd7b6d7350a 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -22,6 +22,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "regs.h"
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index 59f60d05bfa..3cfc061920f 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -1903,18 +1903,9 @@ do { \
sprintf (LABEL, "*.%s%d", PREFIX, NUM); \
} while (0)
-/* A C expression to assign to OUTVAR (which is a variable of type `char *') a
- newly allocated string made from the string NAME and the number NUMBER, with
- some suitable punctuation added. */
-
/* ??? Not sure if using a ? in the name for Intel as is safe. */
-#define ASM_FORMAT_PRIVATE_NAME(OUTVAR, NAME, NUMBER) \
-do { \
- (OUTVAR) = (char *) alloca (strlen (NAME) + 12); \
- sprintf (OUTVAR, "%s%c%ld", (NAME), (TARGET_GNU_AS ? '.' : '?'), \
- (long)(NUMBER)); \
-} while (0)
+#define ASM_PN_FORMAT (TARGET_GNU_AS ? "%s.%lu" : "%s?%lu")
/* A C statement to output to the stdio stream STREAM assembler code which
defines (equates) the symbol NAME to have the value VALUE. */
@@ -2231,7 +2222,7 @@ do { \
/* Use tags for debug info labels, so that they don't break instruction
bundles. This also avoids getting spurious DV warnings from the
- assembler. This is similar to ASM_OUTPUT_INTERNAL_LABEL, except that we
+ assembler. This is similar to (*targetm.asm_out.internal_label), except that we
add brackets around the label. */
#define ASM_OUTPUT_DEBUG_LABEL(FILE, PREFIX, NUM) \
diff --git a/gcc/config/ia64/t-ia64 b/gcc/config/ia64/t-ia64
index 0cfd9483879..67362a898cd 100644
--- a/gcc/config/ia64/t-ia64
+++ b/gcc/config/ia64/t-ia64
@@ -43,5 +43,5 @@ crtfastmath.o: $(srcdir)/config/ia64/crtfastmath.c $(GCC_PASSES)
LIB2ADDEH = $(srcdir)/config/ia64/unwind-ia64.c $(srcdir)/unwind-sjlj.c
ia64-c.o: $(srcdir)/config/ia64/ia64-c.c $(CONFIG_H) $(SYSTEM_H) \
- $(TREE_H) $(CPPLIB_H) $(C_COMMON_H) c-pragma.h toplev.h
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+ coretypes.h $(TM_H) $(TREE_H) $(CPPLIB_H) $(C_COMMON_H) c-pragma.h toplev.h
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/ia64/ia64-c.c
diff --git a/gcc/config/interix.h b/gcc/config/interix.h
index 8d9f58f8b5b..d04e5477dd7 100644
--- a/gcc/config/interix.h
+++ b/gcc/config/interix.h
@@ -70,19 +70,6 @@ for windows/multi thread */
&& strcmp (STR, "Tbss"))
-#if 0
-/* don't do this until we can sort out the default path issues. MK */
-#undef STANDARD_EXEC_PREFIX
-#define STANDARD_EXEC_PREFIX ""
-
-#undef STANDARD_STARTFILE_PREFIX
-#define STANDARD_STARTFILE_PREFIX ""
-
-#undef TOOLDIR_BASE_PREFIX
-#define TOOLDIR_BASE_PREFIX ""
-
-#endif /* 0 */
-
#define STDC_0_IN_SYSTEM_HEADERS 1
#define HANDLE_SYSV_PRAGMA 1
diff --git a/gcc/config/ip2k/ip2k.c b/gcc/config/ip2k/ip2k.c
index c0a643ae1d1..93d2ab27f5c 100644
--- a/gcc/config/ip2k/ip2k.c
+++ b/gcc/config/ip2k/ip2k.c
@@ -22,6 +22,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
diff --git a/gcc/config/ip2k/ip2k.h b/gcc/config/ip2k/ip2k.h
index 00be9c4408d..467dfa7b2d2 100644
--- a/gcc/config/ip2k/ip2k.h
+++ b/gcc/config/ip2k/ip2k.h
@@ -2129,28 +2129,6 @@ do { \
/* Globalizing directive for a label. */
#define GLOBAL_ASM_OP ".global\t"
-#undef ASM_FORMAT_PRIVATE_NAME
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
-/* A C expression to assign to OUTVAR (which is a variable of type
- `char *') a newly allocated string made from the string NAME and
- the number NUMBER, with some suitable punctuation added. Use
- `alloca' to get space for the string.
-
- The string will be used as an argument to `ASM_OUTPUT_LABELREF' to
- produce an assembler label for an internal static variable whose
- name is NAME. Therefore, the string must be such as to result in
- valid assembler code. The argument NUMBER is different each time
- this macro is executed; it prevents conflicts between
- similarly-named internal static variables in different scopes.
-
- Ideally this string should not be a valid C identifier, to prevent
- any conflict with the user's own symbols. Most assemblers allow
- periods or percent signs in assembler symbols; putting at least
- one of these between the name and the number will suffice. */
-
#define REGISTER_NAMES { \
"$00","$01","$02","$03","iph","ipl","sph","spl", \
"pch","pcl","wreg","status","dph","dpl","$0e","mulh", \
@@ -2266,7 +2244,7 @@ do { \
The definition should be a C statement to output to the stdio
stream STREAM an assembler pseudo-instruction to generate a
reference to a label. VALUE is the number of an internal label
- whose definition is output using `ASM_OUTPUT_INTERNAL_LABEL'. For
+ whose definition is output using `(*targetm.asm_out.internal_label)'. For
example,
fprintf ((STREAM), "\t.word L%d\n", (VALUE)) */
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index 5903277c8c2..b95a4684a34 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "regs.h"
diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h
index f5513b8449f..195b4682a1f 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -1694,17 +1694,6 @@ sbss_section () \
} \
while (0)
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
- do \
- { \
- (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10);\
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)); \
- } \
- while (0)
-
/* How to refer to registers in assembler output.
This sequence is indexed by compiler's hard-register-number (see above). */
#ifndef SUBTARGET_REGISTER_NAMES
diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c
index ac16b527a97..6f616594605 100644
--- a/gcc/config/m68hc11/m68hc11.c
+++ b/gcc/config/m68hc11/m68hc11.c
@@ -35,6 +35,8 @@ Note:
#include <stdio.h>
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "tm_p.h"
@@ -64,7 +66,6 @@ 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 m68hc11_autoinc_compatible_p PARAMS ((rtx, rtx));
static int must_parenthesize PARAMS ((rtx));
static int m68hc11_shift_cost PARAMS ((enum machine_mode, rtx, int));
static int m68hc11_auto_inc_p PARAMS ((rtx));
@@ -78,6 +79,8 @@ 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_encode_section_info PARAMS((tree, int));
+static int autoinc_mode PARAMS((rtx));
+static int m68hc11_make_autoinc_notes PARAMS((rtx *, void *));
rtx m68hc11_soft_tmp_reg;
diff --git a/gcc/config/m68hc11/m68hc11.h b/gcc/config/m68hc11/m68hc11.h
index bdd3fe198f9..393ab7bbf42 100644
--- a/gcc/config/m68hc11/m68hc11.h
+++ b/gcc/config/m68hc11/m68hc11.h
@@ -1604,16 +1604,6 @@ do { \
assemble_name (FILE, NAME); \
fputs ("\n", FILE);}
-
-
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
/* How to refer to registers in assembler output. This sequence is indexed
by compiler's hard-register-number (see above). */
#define REGISTER_NAMES \
diff --git a/gcc/config/m68hc11/m68hc11.md b/gcc/config/m68hc11/m68hc11.md
index a71e4f3f0f5..beeded3d6ad 100644
--- a/gcc/config/m68hc11/m68hc11.md
+++ b/gcc/config/m68hc11/m68hc11.md
@@ -1483,7 +1483,7 @@
if (X_REG_P (operands[0]))
output_asm_insn (\"dex\", operands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (ops[2]));
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\", CODE_LABEL_NUMBER (ops[2]));
if (!X_REG_P (operands[0]))
{
@@ -1552,7 +1552,7 @@
output_asm_insn (\"bpl\\t%l0\", ops);
output_asm_insn (\"deca\", operands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (ops[0]));
}
else
@@ -1570,7 +1570,7 @@
output_asm_insn (\"bpl\\t%l0\", ops);
}
output_asm_insn (\"dec\\t%h0\", operands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (ops[0]));
}
@@ -1653,7 +1653,7 @@
ops[0] = gen_label_rtx ();
output_asm_insn (\"bpl\\t%l0\", ops);
output_asm_insn (\"dex\", operands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (ops[0]));
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\", CODE_LABEL_NUMBER (ops[0]));
return \"\";
}")
@@ -1810,7 +1810,7 @@
output_asm_insn (\"inx\", ops);
CC_STATUS_INIT;
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (ops[2]));
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\", CODE_LABEL_NUMBER (ops[2]));
return \"\";
}")
@@ -1892,7 +1892,7 @@
output_asm_insn (\"bcc\\t%l3\", ops);
output_asm_insn (\"inx\", ops);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (ops[3]));
}
CC_STATUS_INIT;
@@ -1995,7 +1995,7 @@
output_asm_insn (inch_mem, ops);
}
}
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (ops[2]));
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\", CODE_LABEL_NUMBER (ops[2]));
CC_STATUS_INIT;
return \"\";
@@ -2060,7 +2060,7 @@
ops[0] = gen_label_rtx ();
output_asm_insn (\"bcc\\t%l0\", ops);
output_asm_insn (\"in%0\", operands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (ops[0]));
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\", CODE_LABEL_NUMBER (ops[0]));
CC_STATUS_INIT;
return \"\";
}")
@@ -2538,7 +2538,7 @@
output_asm_insn (\"subd\\t%2\", operands);
output_asm_insn (\"bcc\\t%l0\", ops);
output_asm_insn (\"dex\", ops);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (ops[0]));
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\", CODE_LABEL_NUMBER (ops[0]));
CC_STATUS_INIT;
return \"\";
}")
@@ -2565,7 +2565,7 @@
output_asm_insn (\"sbca\\t#0\", operands);
output_asm_insn (\"bcc\\t%l0\", ops);
output_asm_insn (\"dex\", ops);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (ops[0]));
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\", CODE_LABEL_NUMBER (ops[0]));
CC_STATUS_INIT;
return \"\";
}")
@@ -3090,7 +3090,7 @@
if ((val & 0x0FF00) != 0x0FF00)
output_asm_insn (\"bclr\\t0,%2, %h1\", operands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (ops[2]));
return \"\";
}
@@ -3241,7 +3241,7 @@
output_asm_insn (\".relax\\t%l2\", ops);
m68hc11_gen_movhi (insn, ops);
output_asm_insn (\"bclr\\t0,%2, %1\", operands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (ops[2]));
return \"\";
}
@@ -3357,7 +3357,7 @@
if ((val & 0x0FF00) != 0)
output_asm_insn (\"bset\\t0,%2, %h1\", operands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (ops[2]));
return \"\";
}
@@ -3455,7 +3455,7 @@
output_asm_insn (\".relax\\t%l2\", ops);
m68hc11_gen_movhi (insn, ops);
output_asm_insn (\"bset\\t0,%2, %1\", operands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (ops[2]));
return \"\";
}
@@ -4283,7 +4283,7 @@
output_asm_insn (\"comb\\n\\tcoma\\n\\tinx\\n\\txgdx\", operands);
output_asm_insn (\"bne\\t%l0\", ops);
output_asm_insn (\"inx\", operands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (ops[0]));
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\", CODE_LABEL_NUMBER (ops[0]));
return \"\";
}")
@@ -4993,7 +4993,7 @@
output_asm_insn (\"comb\", operands);
CC_STATUS_INIT;
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (ops[0]));
return \"\";
}
@@ -5007,7 +5007,7 @@
output_asm_insn (\"bge\\t%l0\", ops);
output_asm_insn (\"deca\", operands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (ops[0]));
val -= 8;
@@ -5030,7 +5030,7 @@
output_asm_insn (\"bcc\\t%l0\", ops);
output_asm_insn (\"coma\", ops);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (ops[0]));
return \"\";
}
@@ -5722,14 +5722,14 @@
ops[1] = gen_label_rtx ();
output_asm_insn (\"ble\\t%l1\", ops);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (ops[0]));
output_asm_insn (\"lsrb\", operands);
output_asm_insn (\"deca\", operands);
output_asm_insn (\"bne\\t%l0\", ops);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (ops[1]));
return \"\";
}")
diff --git a/gcc/config/m68k/3b1.h b/gcc/config/m68k/3b1.h
index d2a1391fd48..655e45c8c81 100644
--- a/gcc/config/m68k/3b1.h
+++ b/gcc/config/m68k/3b1.h
@@ -96,7 +96,6 @@ output_file_directive ((FILE), main_input_filename)
/* Override parts of m68k.h to fit the SGS-3b1 assembler. */
#undef TARGET_VERSION
-#undef ASM_FORMAT_PRIVATE_NAME
#undef ASM_OUTPUT_ALIGN
#undef ASM_OUTPUT_SOURCE_FILENAME
#undef ASM_OUTPUT_SOURCE_LINE
@@ -105,7 +104,6 @@ output_file_directive ((FILE), main_input_filename)
#undef FUNCTION_PROFILER
#undef ASM_OUTPUT_ADDR_VEC_ELT
#undef ASM_OUTPUT_ADDR_DIFF_ELT
-#undef ASM_OUTPUT_INTERNAL_LABEL
#undef ASM_OUTPUT_OPCODE
#undef ASM_OUTPUT_LOCAL
#undef USER_LABEL_PREFIX
@@ -113,13 +111,7 @@ output_file_directive ((FILE), main_input_filename)
#define TARGET_VERSION fprintf (stderr, " (68k, SGS/AT&T unixpc syntax)");
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12), \
- sprintf ((OUTPUT), "%s_%%%d", (NAME), (LABELNO)))
+#define ASM_PN_FORMAT "%s_%%%lu"
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
do { \
@@ -323,9 +315,6 @@ do { \
#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
sprintf ((LABEL), "%s%%%ld", (PREFIX), (long)(NUM))
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, "%s%%%d:\n", PREFIX, NUM)
-
/* Must put address in %a0 , not %d0 . -- LGM, 7/15/88 */
#define FUNCTION_PROFILER(FILE, LABEL_NO) \
fprintf (FILE, "\tmov.l &LP%%%d,%%a0\n\tjsr mcount\n", (LABEL_NO))
diff --git a/gcc/config/m68k/amix.h b/gcc/config/m68k/amix.h
index b302d0ece2f..b634f391f8f 100644
--- a/gcc/config/m68k/amix.h
+++ b/gcc/config/m68k/amix.h
@@ -142,10 +142,3 @@ do { \
else \
sprintf (LABEL, "*%s%s%ld", LOCAL_LABEL_PREFIX, PREFIX, (long)(NUM)); \
} while (0)
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- if (flag_pic && !strcmp(PREFIX,"LC")) \
- fprintf (FILE, "%s%%%d:\n", PREFIX, NUM); \
- else \
- asm_fprintf (FILE, "%0L%s%d:\n", PREFIX, NUM)
diff --git a/gcc/config/m68k/atari.h b/gcc/config/m68k/atari.h
index 54ea0c2dad6..67528c3a7df 100644
--- a/gcc/config/m68k/atari.h
+++ b/gcc/config/m68k/atari.h
@@ -99,10 +99,3 @@ do { \
else \
sprintf (LABEL, "*%s%s%ld", LOCAL_LABEL_PREFIX, PREFIX, (long)(NUM)); \
} while (0)
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- if (flag_pic && !strcmp(PREFIX,"LC")) \
- fprintf (FILE, "%s%%%d:\n", PREFIX, NUM); \
- else \
- asm_fprintf (FILE, "%0L%s%d:\n", PREFIX, NUM)
diff --git a/gcc/config/m68k/hp320.h b/gcc/config/m68k/hp320.h
index 680aab4c2f6..a7839bac1f9 100644
--- a/gcc/config/m68k/hp320.h
+++ b/gcc/config/m68k/hp320.h
@@ -171,9 +171,7 @@ Boston, MA 02111-1307, USA. */
#undef ASM_OUTPUT_SKIP
#undef ASM_OUTPUT_COMMON
#undef ASM_OUTPUT_LOCAL
-#undef ASM_FORMAT_PRIVATE_NAME
#undef FUNCTION_PROFILER
-#undef ASM_OUTPUT_INTERNAL_LABEL
#undef GLOBAL_ASM_OP
#undef IMMEDIATE_PREFIX
#undef REGISTER_PREFIX
@@ -249,20 +247,7 @@ Boston, MA 02111-1307, USA. */
assemble_name ((FILE), (NAME)), \
fprintf ((FILE), ",%u,2\n", (ROUNDED)))
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12), \
- sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
-
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
-do{ if (PREFIX[0] == 'L' && PREFIX[1] == 'I') \
- fprintf(FILE, "\tset %s%d,.+2\n", PREFIX, NUM); \
- else \
- fprintf (FILE, "%s%d:\n", PREFIX, NUM); \
-} while(0)
+#define ASM_PN_FORMAT "%s___%lu"
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
fprintf (FILE, "\tlong L%d\n", VALUE)
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 0407dd6b8db..c7e0e5cdfad 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "function.h"
@@ -65,6 +67,9 @@ static void m68k_coff_asm_named_section PARAMS ((const char *, unsigned int));
#ifdef CTOR_LIST_BEGIN
static void m68k_svr3_asm_out_constructor PARAMS ((rtx, int));
#endif
+#ifdef HPUX_ASM
+static void m68k_hp320_internal_label PARAMS ((FILE *, const char *, unsigned long));
+#endif
static void m68k_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
static int m68k_save_reg PARAMS ((unsigned int));
@@ -124,6 +129,10 @@ int m68k_last_compare_had_fp_operands;
#define TARGET_ASM_FUNCTION_PROLOGUE m68k_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE m68k_output_function_epilogue
+#ifdef HPUX_ASM
+#undef TARGET_ASM_INTERNAL_LABEL
+#define TARGET_ASM_INTERNAL_LABEL m68k_hp320_internal_label
+#endif
#undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK m68k_output_mi_thunk
@@ -1377,13 +1386,13 @@ output_scc_di(op, operand1, operand2, dest)
switch (op_code)
{
case EQ:
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (loperands[4]));
output_asm_insn ("seq %5", loperands);
break;
case NE:
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (loperands[4]));
output_asm_insn ("sne %5", loperands);
break;
@@ -1395,15 +1404,15 @@ output_scc_di(op, operand1, operand2, dest)
#else
output_asm_insn ("shi %5\n\tjra %l6", loperands);
#endif
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (loperands[4]));
output_asm_insn ("sgt %5", loperands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (loperands[6]));
break;
case GTU:
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (loperands[4]));
output_asm_insn ("shi %5", loperands);
break;
@@ -1415,15 +1424,15 @@ output_scc_di(op, operand1, operand2, dest)
#else
output_asm_insn ("scs %5\n\tjra %l6", loperands);
#endif
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (loperands[4]));
output_asm_insn ("slt %5", loperands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (loperands[6]));
break;
case LTU:
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (loperands[4]));
output_asm_insn ("scs %5", loperands);
break;
@@ -1435,15 +1444,15 @@ output_scc_di(op, operand1, operand2, dest)
#else
output_asm_insn ("scc %5\n\tjra %l6", loperands);
#endif
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (loperands[4]));
output_asm_insn ("sge %5", loperands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (loperands[6]));
break;
case GEU:
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (loperands[4]));
output_asm_insn ("scc %5", loperands);
break;
@@ -1455,15 +1464,15 @@ output_scc_di(op, operand1, operand2, dest)
#else
output_asm_insn ("sls %5\n\tjra %l6", loperands);
#endif
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (loperands[4]));
output_asm_insn ("sle %5", loperands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (loperands[6]));
break;
case LEU:
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (loperands[4]));
output_asm_insn ("sls %5", loperands);
break;
@@ -1878,7 +1887,7 @@ output_move_himode (operands)
CODE_LABEL_NUMBER (XEXP (labelref, 0)));
#endif /* not SGS */
#else /* SGS_SWITCH_TABLES or not MOTOROLA */
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LI",
+ (*targetm.asm_out.internal_label) (asm_out_file, "LI",
CODE_LABEL_NUMBER (XEXP (labelref, 0)));
#ifdef SGS_SWITCH_TABLES
/* Set flag saying we need to define the symbol
@@ -3856,6 +3865,20 @@ m68k_svr3_asm_out_constructor (symbol, priority)
}
#endif
+#ifdef HPUX_ASM
+static void
+m68k_hp320_internal_label (stream, prefix, labelno)
+ FILE *stream;
+ const char *prefix;
+ unsigned long labelno;
+{
+ if (prefix[0] == 'L' && prefix[1] == 'I')
+ fprintf(stream, "\tset %s%ld,.+2\n", prefix, labelno);
+ else
+ fprintf (stream, "%s%ld:\n", prefix, labelno);
+}
+#endif
+
static void
m68k_output_mi_thunk (file, thunk, delta, vcall_offset, function)
FILE *file;
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index 795a9793c55..7d07a13a962 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -1190,10 +1190,8 @@ __transfer_from_trampoline () \
/* Addressing modes, and classification of registers for them. */
#define HAVE_POST_INCREMENT 1
-/* #define HAVE_POST_DECREMENT 0 */
#define HAVE_PRE_DECREMENT 1
-/* #define HAVE_PRE_INCREMENT 0 */
/* Macros to check register numbers against specific register classes. */
@@ -1758,12 +1756,6 @@ __transfer_from_trampoline () \
#define ASM_OUTPUT_LABELREF(FILE,NAME) \
asm_fprintf (FILE, "%0U%s", NAME)
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- asm_fprintf (FILE, "%0L%s%d:\n", PREFIX, NUM)
-
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
@@ -1825,14 +1817,6 @@ __transfer_from_trampoline () \
assemble_name ((FILE), (NAME)), \
fprintf ((FILE), ",%u\n", (ROUNDED)))
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
/* Output a float value (represented as a C double) as an immediate operand.
This macro is a 68k-specific macro. */
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index 969e5dc3099..8ce07245216 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -2326,7 +2326,7 @@
#else
output_asm_insn (\"add%.l %#1,%2\", operands);
#endif
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (operands[3]));
return \"\";
}")
@@ -6187,7 +6187,7 @@
output_asm_insn (\"cmp%.w %#0,%0\;jne %l4\;cmp%.w %#0,%3\;jeq %l1\", operands);
#endif
}
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (operands[4]));
return \"\";
} ")
@@ -7481,7 +7481,7 @@
CODE_LABEL_NUMBER (XEXP (labelref, 0)));
#endif /* not SGS */
#else /* SGS_SWITCH_TABLES or not MOTOROLA */
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"LI\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"LI\",
CODE_LABEL_NUMBER (XEXP (labelref, 0)));
#ifdef SGS_SWITCH_TABLES
/* Set flag saying we need to define the symbol
diff --git a/gcc/config/m68k/mot3300.h b/gcc/config/m68k/mot3300.h
index fb7dffa8fc7..6304e531dea 100644
--- a/gcc/config/m68k/mot3300.h
+++ b/gcc/config/m68k/mot3300.h
@@ -276,14 +276,7 @@ Boston, MA 02111-1307, USA. */
#define GLOBAL_ASM_OP "\tglobal\t"
#endif /* USE_GAS */
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#undef ASM_FORMAT_PRIVATE_NAME
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12), \
- sprintf ((OUTPUT), "%s_%%%d", (NAME), (LABELNO)))
+#define ASM_PN_FORMAT "%s_%%%lu"
#undef INT_OP_GROUP
#ifdef USE_GAS
@@ -393,13 +386,6 @@ Boston, MA 02111-1307, USA. */
#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
sprintf ((LABEL), "%s%s%ld", LOCAL_LABEL_PREFIX, (PREFIX), (long)(NUM))
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- asm_fprintf (FILE, "%L%s%d:\n", PREFIX, NUM)
-
/* The prefix to add to user-visible assembler symbols. */
#undef USER_LABEL_PREFIX
@@ -411,7 +397,7 @@ Boston, MA 02111-1307, USA. */
/* The L after the local prefix is the "L" prefix for the normal labels
generated by gcc; why are ASM_OUTPUT_ADDR_VEC_ELT and
ASM_OUTPUT_ADDR_DIFF_ELT not called with a PREFIX parameter, like
- ASM_OUTPUT_INTERNAL_LABEL ? */
+ (*targetm.asm_out.internal_label) ? */
#undef ASM_OUTPUT_ADDR_VEC_ELT
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
diff --git a/gcc/config/m68k/netbsd-elf.h b/gcc/config/m68k/netbsd-elf.h
index f9576da2905..62f67ef534d 100644
--- a/gcc/config/m68k/netbsd-elf.h
+++ b/gcc/config/m68k/netbsd-elf.h
@@ -103,10 +103,12 @@ Boston, MA 02111-1307, USA. */
#undef ASM_SPEC
#define ASM_SPEC \
- " %| %(asm_default_spec) \
+ "%(asm_default_spec) \
%{m68010} %{m68020} %{m68030} %{m68040} %{m68060} \
%{fpic:-k} %{fPIC:-k -K}"
+#define AS_NEEDS_DASH_FOR_PIPED_INPUT
+
/* Provide a LINK_SPEC appropriate for a NetBSD/m68k ELF target. */
#undef LINK_SPEC
diff --git a/gcc/config/m68k/netbsd.h b/gcc/config/m68k/netbsd.h
index fcf9f531e5a..69a88afe0d5 100644
--- a/gcc/config/m68k/netbsd.h
+++ b/gcc/config/m68k/netbsd.h
@@ -31,7 +31,9 @@
"%{!msoft-float:-D__HAVE_68881__ -D__HAVE_FPU__} %(netbsd_cpp_spec)"
#undef ASM_SPEC
-#define ASM_SPEC " %| %{m68030} %{m68040} %{m68060} %{fpic:-k} %{fPIC:-k -K}"
+#define ASM_SPEC "%{m68030} %{m68040} %{m68060} %{fpic:-k} %{fPIC:-k -K}"
+
+#define AS_NEEDS_DASH_FOR_PIPED_INPUT
/* Make gcc agree with <machine/ansi.h> */
diff --git a/gcc/config/m68k/openbsd.h b/gcc/config/m68k/openbsd.h
index 0a5038c4dc7..baa4ef0928c 100644
--- a/gcc/config/m68k/openbsd.h
+++ b/gcc/config/m68k/openbsd.h
@@ -38,7 +38,9 @@ Boston, MA 02111-1307, USA. */
/* m68k as needs to know about the processor subtype. */
#undef ASM_SPEC
-#define ASM_SPEC "%| %{m68030} %{m68040} %{m68060} %{fpic:-k} %{fPIC:-k -K}"
+#define ASM_SPEC "%{m68030} %{m68040} %{m68060} %{fpic:-k} %{fPIC:-k -K}"
+
+#define AS_NEEDS_DASH_FOR_PIPED_INPUT
/* Layout of source language data types. */
diff --git a/gcc/config/m68k/sgs.h b/gcc/config/m68k/sgs.h
index 949ea7dcaa7..fb799bed6bd 100644
--- a/gcc/config/m68k/sgs.h
+++ b/gcc/config/m68k/sgs.h
@@ -42,7 +42,7 @@ Boston, MA 02111-1307, USA. */
#define SWBEG_ASM_OP "\t.swbeg "
#define SET_ASM_OP "\t.set "
-#define ASM_PN_FORMAT "%s_%d" /* Format for private names */
+#define ASM_PN_FORMAT "%s_%lu" /* Format for private names */
/* Here are four prefixes that are used by asm_fprintf to
facilitate customization for alternate assembler syntaxes.
@@ -360,7 +360,7 @@ do { \
#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
do { \
ASM_OUTPUT_BEFORE_CASE_LABEL((FILE),(PREFIX),(NUM),(TABLE)); \
- ASM_OUTPUT_INTERNAL_LABEL((FILE),(PREFIX),(NUM)); \
+ (*targetm.asm_out.internal_label)((FILE),(PREFIX),(NUM)); \
} while (0)
/* At end of a switch table, define LDnnn iff the symbol LInnn was defined.
@@ -390,13 +390,3 @@ extern int switch_table_difference_label_flag;
keep switch tables in the text section. */
#define JUMP_TABLES_IN_TEXT_SECTION 1
-
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#undef ASM_FORMAT_PRIVATE_NAME
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), ASM_PN_FORMAT, (NAME), (LABELNO)))
-
diff --git a/gcc/config/m68k/t-vxworks68 b/gcc/config/m68k/t-vxworks68
deleted file mode 100644
index f3f8d7bd13c..00000000000
--- a/gcc/config/m68k/t-vxworks68
+++ /dev/null
@@ -1,24 +0,0 @@
-LIB1ASMSRC = m68k/lb1sf68.asm
-LIB1ASMFUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
- _double _float _floatex \
- _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
- _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
-
-# We don't want to put exit in libgcc.a for VxWorks, because VxWorks
-# does not have _exit.
-TARGET_LIBGCC2_CFLAGS = -Dexit=unused_exit
-
-LIB2FUNCS_EXTRA = fpgnulib.c xfgnulib.c
-
-fpgnulib.c: $(srcdir)/config/m68k/fpgnulib.c
- cp $(srcdir)/config/m68k/fpgnulib.c fpgnulib.c
-xfgnulib.c: $(srcdir)/config/m68k/fpgnulib.c
- echo '#define EXTFLOAT' > xfgnulib.c
- cat $(srcdir)/config/m68k/fpgnulib.c >> xfgnulib.c
-
-MULTILIB_OPTIONS = m68000/m68020 m68881/msoft-float
-MULTILIB_DIRNAMES =
-MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 m68000=m68332 m68020=mc68020 m68020=m68040
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/m68k/tower-as.h b/gcc/config/m68k/tower-as.h
index 3e0e9b60f9e..f81268b061c 100644
--- a/gcc/config/m68k/tower-as.h
+++ b/gcc/config/m68k/tower-as.h
@@ -46,7 +46,7 @@ Boston, MA 02111-1307, USA. */
#define CPP_SPEC "-D__TOWER_ASM__ %{m68881:-D__HAVE_68881__}"
/* We don't want local labels to start with period.
- See ASM_OUTPUT_INTERNAL_LABEL. */
+ See (*targetm.asm_out.internal_label). */
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX ""
@@ -210,14 +210,7 @@ Boston, MA 02111-1307, USA. */
assemble_name ((FILE), (NAME)), \
fprintf ((FILE), ",%d\n", ((SIZE) == 0) ? (ROUNDED) : (SIZE)))
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#undef ASM_FORMAT_PRIVATE_NAME
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 11), \
- sprintf ((OUTPUT), "%s%%%%%d", (NAME), (LABELNO)))
+#define ASM_PN_FORMAT "%s%%%%%lu"
/* This is the command to make the user-level label named NAME
defined for reference from other files. */
@@ -229,10 +222,6 @@ Boston, MA 02111-1307, USA. */
#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
sprintf ((LABEL), "%s%%%ld", (PREFIX), (long)(NUM))
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf ((FILE), "%s%%%d:\n", (PREFIX), (NUM))
-
#undef ASM_OUTPUT_CASE_LABEL
#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
fprintf (FILE, "\tswbeg &%d\n%s%%%d:\n", \
diff --git a/gcc/config/m68k/vxm68k.h b/gcc/config/m68k/vxm68k.h
deleted file mode 100644
index a4daa367afa..00000000000
--- a/gcc/config/m68k/vxm68k.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Definitions of target machine for GNU compiler. Vxworks m68k version.
- Copyright (C) 1994, 1996, 1997, 1998 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. */
-
-/* This comment is here to see if it will keep Sun's cpp from dying. */
-
-#include "m68k/m68k-none.h"
-#include "aoutos.h"
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dmc68000 -D__vxworks -D__vxworks_5 -Acpu=m68k -Amachine=m68k"
-
-/* The default value for -DCPU=. */
-#if TARGET_CPU_DEFAULT == M68K_CPU_m68k || TARGET_CPU_DEFAULT == M68K_CPU_m68020
-#define CPP_SUBTARGET_CPU_DEFAULT_SPEC "-DCPU=MC68020"
-#else
-#if TARGET_CPU_DEFAULT == M68K_CPU_m68000
-#define CPP_SUBTARGET_CPU_DEFAULT_SPEC "-DCPU=MC68000"
-#else
-#if TARGET_CPU_DEFAULT == M68K_CPU_m68030
-#define CPP_SUBTARGET_CPU_DEFAULT_SPEC "-DCPU=MC68030"
-#else
-#if TARGET_CPU_DEFAULT == M68K_CPU_m68040
-#define CPP_SUBTARGET_CPU_DEFAULT_SPEC "-DCPU=MC68040"
-#else
-#if TARGET_CPU_DEFAULT == M68K_CPU_m68302
-#define CPP_SUBTARGET_CPU_DEFAULT_SPEC "-DCPU=MC68302"
-#else
-#if TARGET_CPU_DEFAULT == M68K_CPU_m68332
-#define CPP_SUBTARGET_CPU_DEFAULT_SPEC "-DCPU=MC68332"
-#else
-Unrecognized value in TARGET_CPU_DEFAULT.
-#endif
-#endif
-#endif
-#endif
-#endif
-#endif
-
-#undef SUBTARGET_EXTRA_SPECS
-#define SUBTARGET_EXTRA_SPECS \
-{ "cpp_subtarget_cpu_default", CPP_SUBTARGET_CPU_DEFAULT_SPEC }
-
-/* Vxworks header files require that the macro CPU be set. */
-/* ??? The previous code didn't set CPU if -ansi. */
-#undef CPP_SUBTARGET_SPEC
-#define CPP_SUBTARGET_SPEC "\
-%{m68000:-DCPU=MC68000 }%{m68010:-DCPU=MC68010 }%{m68020:-DCPU=MC68020 }%{mc68020:-DCPU=MC68020 }%{m68030:-DCPU=MC68030 }%{m68040:-DCPU=MC68040 }%{m68020-40:-DCPU=MC68020 }%{m68302:-DCPU=MC68000 }%{m68332:-DCPU=CPU32 } \
-%{!mc68000:%{!m68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:%(cpp_subtarget_cpu_default) }}}}}}}}}} \
-"
-
-#define DBX_DEBUGGING_INFO 1
-#undef SDB_DEBUGGING_INFO
-
-/* These are the official values from WRS. */
-#undef WCHAR_TYPE
-#define WCHAR_TYPE "char"
-#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE 8
-#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "long int"
-#undef SIZE_TYPE
-#define SIZE_TYPE "unsigned int"
-
-/* VxWorks does all the library stuff itself. */
-
-#define LIB_SPEC ""
-
-/* Provide required defaults for linker. */
-
-#define LINK_SPEC "-r"
-
-/* VxWorks provides the functionality of crt0.o and friends itself. */
-
-#define STARTFILE_SPEC ""
-
-/* Every structure or union's size must be a multiple of 2 bytes. */
-
-#define STRUCTURE_SIZE_BOUNDARY 16
-
-/* GCC is the primary compiler for VxWorks, so we don't need this. */
-#undef PCC_STATIC_STRUCT_RETURN
-
-/* Restrict use of 128 bit floating-point by default since VxWorks doesn't
- have the proper accuracy routines for that size; this is not done because
- the hardware doesn't support it, despite the name. */
-#define WIDEST_HARDWARE_FP_SIZE 64
diff --git a/gcc/config/m88k/m88k.c b/gcc/config/m88k/m88k.c
index fde0d14a2a1..44ca220c4e1 100644
--- a/gcc/config/m88k/m88k.c
+++ b/gcc/config/m88k/m88k.c
@@ -23,6 +23,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -74,6 +76,9 @@ static void m88k_svr3_asm_out_destructor PARAMS ((rtx, int));
static void m88k_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT));
static int m88k_adjust_cost PARAMS ((rtx, rtx, rtx, int));
static void m88k_encode_section_info PARAMS ((tree, int));
+#ifdef AS_BUG_DOT_LABELS
+static void m88k_internal_label PARAMS ((FILE *, const char *, unsigned long));
+#endif
/* Initialize the GCC target structure. */
#undef TARGET_ASM_BYTE_OP
@@ -101,6 +106,10 @@ static void m88k_encode_section_info PARAMS ((tree, int));
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO m88k_encode_section_info
+#ifdef AS_BUG_DOT_LABELS
+#undef TARGET_ASM_INTERNAL_LABEL
+#define TARGET_ASM_INTERNAL_LABEL m88k_internal_label
+#endif
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -892,7 +901,9 @@ output_call (operands, addr)
jump = XVECEXP (final_sequence, 0, 1);
if (GET_CODE (jump) == JUMP_INSN)
{
+#ifndef USE_GAS
rtx low, high;
+#endif
const char *last;
rtx dest = XEXP (SET_SRC (PATTERN (jump)), 0);
int delta = 4 * (INSN_ADDRESSES (INSN_UID (dest))
@@ -1714,7 +1725,7 @@ void
output_label (label_number)
int label_number;
{
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L", label_number);
+ (*targetm.asm_out.internal_label) (asm_out_file, "L", label_number);
}
/* Generate the assembly code for function entry.
@@ -3339,3 +3350,15 @@ m88k_encode_section_info (decl, first)
SYMBOL_REF_FLAG (XEXP (TREE_CST_RTL (decl), 0)) = 1;
}
}
+
+#ifdef AS_BUG_DOT_LABELS /* The assembler requires a declaration of local. */
+static void
+m88k_internal_label (stream, prefix, labelno)
+ FILE *stream;
+ const char *prefix;
+ unsigned long labelno;
+{
+ fprintf (stream, TARGET_SVR4 ? ".%s%lu:\n%s.%s%lu\n" : "@%s%ld:\n",
+ prefix, labelno, INTERNAL_ASM_OP, prefix, labelno);
+}
+#endif
diff --git a/gcc/config/m88k/m88k.h b/gcc/config/m88k/m88k.h
index 659f5fbe801..c702094f423 100644
--- a/gcc/config/m88k/m88k.h
+++ b/gcc/config/m88k/m88k.h
@@ -1104,7 +1104,7 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
fprintf (FILE, "\tor\t %s,%s,0\n", reg_names[11], reg_names[1]); \
/* Locate this block; transfer to the next instruction. */ \
fprintf (FILE, "\tbsr\t %s\n", &buf[1]); \
- ASM_OUTPUT_INTERNAL_LABEL (FILE, "LTRMP", labelno); \
+ (*targetm.asm_out.internal_label) (FILE, "LTRMP", labelno); \
/* Save r10; use it as the relative pointer; restore r1. */ \
fprintf (FILE, "\tst\t %s,%s,24\n", reg_names[10], reg_names[1]); \
fprintf (FILE, "\tor\t %s,%s,0\n", reg_names[10], reg_names[1]); \
@@ -1155,12 +1155,6 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
#define SELECT_CC_MODE(OP,X,Y) CCmode
-/* #define HAVE_POST_INCREMENT 0 */
-/* #define HAVE_POST_DECREMENT 0 */
-
-/* #define HAVE_PRE_DECREMENT 0 */
-/* #define HAVE_PRE_INCREMENT 0 */
-
/* Recognize any constant value that is a valid address.
When PIC, we do not accept an address that would require a scratch reg
to load into a register. */
@@ -1877,25 +1871,11 @@ do { \
fputs (NAME, FILE); \
}
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class.
- For V.4, labels use `.' rather than `@'. */
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#ifdef AS_BUG_DOT_LABELS /* The assembler requires a declaration of local. */
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, TARGET_SVR4 ? ".%s%d:\n%s.%s%d\n" : "@%s%d:\n", \
- PREFIX, NUM, INTERNAL_ASM_OP, PREFIX, NUM)
-#else
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, TARGET_SVR4 ? ".%s%d:\n" : "@%s%d:\n", PREFIX, NUM)
-#endif /* AS_BUG_DOT_LABELS */
-
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
This is suitable for output with `assemble_name'. This must agree
- with ASM_OUTPUT_INTERNAL_LABEL above, except for being prefixed
+ with (*targetm.asm_out.internal_label) above, except for being prefixed
with an `*'. */
#undef ASM_GENERATE_INTERNAL_LABEL
@@ -1917,7 +1897,7 @@ do { \
readonly_data_section (); \
ASM_OUTPUT_ALIGN (FILE, 2); \
} \
- ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); \
} while (0)
/* Epilogue for case labels. This jump instruction is called by casesi
@@ -1992,13 +1972,6 @@ do { \
assemble_name ((FILE), (NAME)), \
fprintf ((FILE), ",%u,%d\n", (SIZE) ? (SIZE) : 1, (SIZE) <= 4 ? 4 : 8))
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
/* This is how to output an insn to push a register on the stack.
It need not be very fast code. */
#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
@@ -2030,10 +2003,10 @@ do { \
#define OCS_END_PREFIX "Lte"
#define PUT_OCS_FUNCTION_START(FILE) \
- { ASM_OUTPUT_INTERNAL_LABEL (FILE, OCS_START_PREFIX, m88k_function_number); }
+ { (*targetm.asm_out.internal_label) (FILE, OCS_START_PREFIX, m88k_function_number); }
#define PUT_OCS_FUNCTION_END(FILE) \
- { ASM_OUTPUT_INTERNAL_LABEL (FILE, OCS_END_PREFIX, m88k_function_number); }
+ { (*targetm.asm_out.internal_label) (FILE, OCS_END_PREFIX, m88k_function_number); }
/* Macros for debug information */
#define DEBUGGER_AUTO_OFFSET(X) \
diff --git a/gcc/config/mcore/mcore-pe.h b/gcc/config/mcore/mcore-pe.h
index a580fc5bfbc..a6ea4d4282c 100644
--- a/gcc/config/mcore/mcore-pe.h
+++ b/gcc/config/mcore/mcore-pe.h
@@ -125,7 +125,7 @@ drectve_section () \
assemble_name (FILE, \
XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
putc ('\n', FILE); \
- ASM_OUTPUT_INTERNAL_LABEL (FILE, "LM", sym_lineno); \
+ (*targetm.asm_out.internal_label) (FILE, "LM", sym_lineno); \
sym_lineno ++; \
} \
}
diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c
index 7068ca696e1..dfe02828bfe 100644
--- a/gcc/config/mcore/mcore.c
+++ b/gcc/config/mcore/mcore.c
@@ -20,6 +20,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "tm_p.h"
@@ -2618,7 +2620,7 @@ mcore_output_jump_label_table ()
{
pool_node * p = pool_vector + i;
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L", CODE_LABEL_NUMBER (p->label));
+ (*targetm.asm_out.internal_label) (asm_out_file, "L", CODE_LABEL_NUMBER (p->label));
output_asm_insn (".long %0", &p->value);
}
diff --git a/gcc/config/mcore/mcore.h b/gcc/config/mcore/mcore.h
index 7bce37cd227..bfa8271b8f7 100644
--- a/gcc/config/mcore/mcore.h
+++ b/gcc/config/mcore/mcore.h
@@ -1173,16 +1173,6 @@ extern long mcore_current_compilation_timestamp;
#define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
sprintf (STRING, "*.%s%ld", PREFIX, (long) NUM)
-/* Output an internal label definition. */
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
-
-/* Construct a private name. */
-#define ASM_FORMAT_PRIVATE_NAME(OUTVAR,NAME,NUMBER) \
- ((OUTVAR) = (char *) alloca (strlen (NAME) + 10), \
- sprintf ((OUTVAR), "%s.%d", (NAME), (NUMBER)))
-
/* Jump tables must be 32 bit aligned. */
#undef ASM_OUTPUT_CASE_LABEL
#define ASM_OUTPUT_CASE_LABEL(STREAM,PREFIX,NUM,TABLE) \
diff --git a/gcc/config/mcore/mcore.md b/gcc/config/mcore/mcore.md
index 7e74a98e061..fe71e377290 100644
--- a/gcc/config/mcore/mcore.md
+++ b/gcc/config/mcore/mcore.md
@@ -3319,7 +3319,7 @@
""
"*
{
- int op0 = REGNO (operands[0]);
+ unsigned int op0 = REGNO (operands[0]);
if (GET_CODE (operands[3]) == REG)
{
diff --git a/gcc/config/mips/irix6-libc-compat.c b/gcc/config/mips/irix6-libc-compat.c
index d482dbfa882..cdac9fafea4 100644
--- a/gcc/config/mips/irix6-libc-compat.c
+++ b/gcc/config/mips/irix6-libc-compat.c
@@ -54,6 +54,8 @@ Boston, MA 02111-1307, USA. */
#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. */
diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
index d25cd51ddcc..959a065d2fc 100644
--- a/gcc/config/mips/linux.h
+++ b/gcc/config/mips/linux.h
@@ -252,3 +252,9 @@ void FN () \
/* The current Linux binutils uses MIPS_STABS_ELF and doesn't support
COFF. */
#undef SDB_DEBUGGING_INFO
+
+#undef LIB_SPEC
+#define LIB_SPEC "\
+%{!static:-rpath-link %R/lib:%R/usr/lib} \
+%{!shared: %{pthread:-lthread} \
+ %{profile:-lc_p} %{!profile: -lc}}"
diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h
index d92f7e573b3..6d3d16783ee 100644
--- a/gcc/config/mips/mips-protos.h
+++ b/gcc/config/mips/mips-protos.h
@@ -140,6 +140,8 @@ extern int mips_legitimate_address_p PARAMS ((enum machine_mode,
extern int mips_reg_mode_ok_for_base_p PARAMS ((rtx,
enum machine_mode,
int));
+extern bool mips_valid_pointer_mode PARAMS ((enum machine_mode));
+
extern int m16_uimm3_b PARAMS ((rtx, enum machine_mode));
extern int m16_simm4_1 PARAMS ((rtx, enum machine_mode));
extern int m16_nsimm4_1 PARAMS ((rtx, enum machine_mode));
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 2dcf69d3f43..f8f3cb6eb7c 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -29,6 +29,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include <signal.h>
#include "rtl.h"
#include "regs.h"
@@ -665,6 +667,9 @@ const struct mips_cpu_info mips_cpu_info_table[] = {
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO mips_encode_section_info
+#undef TARGET_VALID_POINTER_MODE
+#define TARGET_VALID_POINTER_MODE mips_valid_pointer_mode
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Return truth value of whether OP can be used as an operands
@@ -6944,7 +6949,6 @@ save_restore_insns (store_p, large_reg, large_offset)
HOST_WIDE_INT gp_offset;
HOST_WIDE_INT fp_offset;
HOST_WIDE_INT end_offset;
- rtx insn;
if (frame_pointer_needed
&& ! BITSET_P (mask, HARD_FRAME_POINTER_REGNUM - GP_REG_FIRST))
@@ -6998,11 +7002,9 @@ save_restore_insns (store_p, large_reg, large_offset)
base_reg_rtx = gen_rtx_REG (Pmode, MIPS_TEMP2_REGNUM);
base_offset = large_offset;
if (Pmode == DImode)
- insn = emit_insn (gen_adddi3 (base_reg_rtx, large_reg,
- stack_pointer_rtx));
+ emit_insn (gen_adddi3 (base_reg_rtx, large_reg, stack_pointer_rtx));
else
- insn = emit_insn (gen_addsi3 (base_reg_rtx, large_reg,
- stack_pointer_rtx));
+ emit_insn (gen_addsi3 (base_reg_rtx, large_reg, stack_pointer_rtx));
}
else
{
@@ -7107,11 +7109,9 @@ save_restore_insns (store_p, large_reg, large_offset)
base_reg_rtx = gen_rtx_REG (Pmode, MIPS_TEMP2_REGNUM);
base_offset = large_offset;
if (Pmode == DImode)
- insn = emit_insn (gen_adddi3 (base_reg_rtx, large_reg,
- stack_pointer_rtx));
+ emit_insn (gen_adddi3 (base_reg_rtx, large_reg, stack_pointer_rtx));
else
- insn = emit_insn (gen_addsi3 (base_reg_rtx, large_reg,
- stack_pointer_rtx));
+ emit_insn (gen_addsi3 (base_reg_rtx, large_reg, stack_pointer_rtx));
}
else
{
@@ -8621,6 +8621,14 @@ mips_class_max_nregs (class, mode)
else
return (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
}
+
+bool
+mips_valid_pointer_mode (mode)
+ enum machine_mode mode;
+{
+ return (mode == SImode || (TARGET_64BIT && mode == DImode));
+}
+
/* For each mips16 function which refers to GP relative symbols, we
use a pseudo register, initialized at the start of the function, to
@@ -10268,7 +10276,7 @@ mips_output_conditional_branch (insn,
else
output_asm_insn ("%#", 0);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (target));
return "";
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 3b784c8883d..5be556f7d70 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -2976,12 +2976,6 @@ typedef struct mips_args {
/* Addressing modes, and classification of registers for them. */
-/* #define HAVE_POST_INCREMENT 0 */
-/* #define HAVE_POST_DECREMENT 0 */
-
-/* #define HAVE_PRE_DECREMENT 0 */
-/* #define HAVE_PRE_INCREMENT 0 */
-
/* These assume that REGNO is a hard or pseudo reg number.
They give nonzero only if REGNO is a hard reg of the suitable class
or a pseudo reg currently allocated to a suitable hard reg.
@@ -4361,14 +4355,6 @@ do { \
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL)
-
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(STREAM,PREFIX,NUM) \
- fprintf (STREAM, "%s%s%d:\n", LOCAL_LABEL_PREFIX, PREFIX, NUM)
-
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
@@ -4399,7 +4385,9 @@ do { \
fprintf (STREAM, "\t%s\t%sL%d-%sLS%d\n", \
Pmode == DImode ? ".dword" : ".word", \
LOCAL_LABEL_PREFIX, VALUE, LOCAL_LABEL_PREFIX, REL); \
- else if (mips_abi == ABI_32 || mips_abi == ABI_O64) \
+ else if (mips_abi == ABI_32 || mips_abi == ABI_O64 \
+ || mips_abi == ABI_N32 \
+ || (TARGET_GAS && mips_abi == ABI_64)) \
fprintf (STREAM, "\t%s\t%sL%d\n", \
Pmode == DImode ? ".gpdword" : ".gpword", \
LOCAL_LABEL_PREFIX, VALUE); \
@@ -4420,7 +4408,7 @@ do { \
do { \
if (TARGET_EMBEDDED_PIC || TARGET_MIPS16) \
function_section (current_function_decl); \
- ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); \
+ (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); \
} while (0)
/* This is how to output an assembler line
@@ -4500,14 +4488,6 @@ sdata_section () \
#undef TARGET_ASM_SELECT_SECTION
#define TARGET_ASM_SELECT_SECTION mips_select_section
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
#define ASM_OUTPUT_REG_PUSH(STREAM,REGNO) \
do \
{ \
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index cc6cda53dba..46e4fdd86a4 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -9799,7 +9799,7 @@ move\\t%0,%z4\\n\\
"*
{
/* .cpadd expands to add REG,REG,$gp when pic, and nothing when not pic. */
- if (mips_abi == ABI_32 || mips_abi == ABI_O64)
+ if (mips_abi == ABI_32 || mips_abi == ABI_O64 || mips_abi == ABI_N32)
output_asm_insn (\".cpadd\\t%0\", operands);
return \"%*j\\t%0\";
}"
@@ -9827,9 +9827,16 @@ move\\t%0,%z4\\n\\
"Pmode == DImode && next_active_insn (insn) != 0
&& GET_CODE (PATTERN (next_active_insn (insn))) == ADDR_DIFF_VEC
&& PREV_INSN (next_active_insn (insn)) == operands[1]"
- "%*j\\t%0"
+ "*
+{
+ /* .cpadd expands to add REG,REG,$gp when pic, and nothing when not pic. */
+ if (TARGET_GAS && mips_abi == ABI_64)
+ output_asm_insn (\".cpadd\\t%0\", operands);
+ return \"%*j\\t%0\";
+}"
[(set_attr "type" "jump")
- (set_attr "mode" "none")])
+ (set_attr "mode" "none")
+ (set_attr "length" "8")])
;; Implement a switch statement when generating embedded PIC code.
;; Switches are implemented by `tablejump' when not using -membedded-pic.
diff --git a/gcc/config/mips/openbsd.h b/gcc/config/mips/openbsd.h
index 02a8f224e57..73a81926be4 100644
--- a/gcc/config/mips/openbsd.h
+++ b/gcc/config/mips/openbsd.h
@@ -21,7 +21,9 @@ Boston, MA 02111-1307, USA. */
/* Definitions needed for OpenBSD, to avoid picking mips 'defaults'. */
/* GAS must know this. */
-#define SUBTARGET_ASM_SPEC "%{fPIC:-KPIC} %|"
+#define SUBTARGET_ASM_SPEC "%{fPIC:-KPIC}"
+
+#define AS_NEEDS_DASH_FOR_PIPED_INPUT
/* CPP specific OpenBSD specs. */
#define SUBTARGET_CPP_SPEC OBSD_CPP_SPEC
diff --git a/gcc/config/mips/vr.h b/gcc/config/mips/vr.h
index 3ef34afbd34..1352599a300 100644
--- a/gcc/config/mips/vr.h
+++ b/gcc/config/mips/vr.h
@@ -28,4 +28,4 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
if it is redundant. */
#define DRIVER_SELF_SPECS \
"%{mabi=eabi:%{!mlong*:%{!mgp32:-mlong64}}}", \
- "%{mabi=32:%{<mgp32}}"
+ "%{mabi=32:%<mgp32}"
diff --git a/gcc/config/mips/vxworks.h b/gcc/config/mips/vxworks.h
deleted file mode 100644
index 67838e201fd..00000000000
--- a/gcc/config/mips/vxworks.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (C) 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. */
-
-#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_sdata, in_sbss
-
-#undef EXTRA_SECTION_FUNCTIONS
-#define EXTRA_SECTION_FUNCTIONS \
- SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP) \
- SECTION_FUNCTION_TEMPLATE(sbss_section, in_sbss, SBSS_SECTION_ASM_OP)
-
-#undef STARTFILE_SPEC
-#undef ENDFILE_SPEC
diff --git a/gcc/config/mmix/mmix-protos.h b/gcc/config/mmix/mmix-protos.h
index 496752c81d4..fb3705a403c 100644
--- a/gcc/config/mmix/mmix-protos.h
+++ b/gcc/config/mmix/mmix-protos.h
@@ -42,8 +42,6 @@ extern void mmix_asm_output_ascii PARAMS ((FILE *, const char *, int));
extern void mmix_asm_output_label PARAMS ((FILE *, const char *));
extern void mmix_asm_weaken_label PARAMS ((FILE *, const char *));
extern void mmix_asm_output_labelref PARAMS ((FILE *, const char *));
-extern void mmix_asm_output_internal_label
- PARAMS ((FILE *, const char *, int));
extern void mmix_asm_output_def PARAMS ((FILE *, const char *, const char *));
extern int mmix_print_operand_punct_valid_p PARAMS ((int));
extern void mmix_asm_output_reg_push PARAMS ((FILE *, int));
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index 8aa1d3a2c9d..db4bb4c1e54 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -1577,17 +1579,6 @@ mmix_asm_output_labelref (stream, name)
name);
}
-/* ASM_OUTPUT_INTERNAL_LABEL. */
-
-void
-mmix_asm_output_internal_label (stream, name, num)
- FILE * stream;
- const char * name;
- int num;
-{
- fprintf (stream, "%s:%d\tIS @\n", name, num);
-}
-
/* ASM_OUTPUT_DEF. */
void
diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h
index b6c4ec70210..562c39e1ef3 100644
--- a/gcc/config/mmix/mmix.h
+++ b/gcc/config/mmix/mmix.h
@@ -992,9 +992,6 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS;
#define ASM_OUTPUT_LABELREF(STREAM, NAME) \
mmix_asm_output_labelref (STREAM, NAME)
-#define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM) \
- mmix_asm_output_internal_label (STREAM, PREFIX, NUM)
-
/* We insert a ":" to disambiguate against user symbols like L5. */
#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
sprintf (LABEL, "*%s:%ld", PREFIX, (long)(NUM))
@@ -1003,9 +1000,7 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS;
":" is seen in the object file; we don't really want that mmixal
feature visible there. We don't want the default, which uses a dot;
that'd be incompatible with mmixal. */
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
- ((OUTPUT) = (char *) alloca (strlen ((NAME)) + 2 + 10), \
- sprintf ((OUTPUT), "%s::%d", (NAME), (LABELNO)))
+#define ASM_PN_FORMAT "%s::%lu"
#define ASM_OUTPUT_DEF(STREAM, NAME, VALUE) \
mmix_asm_output_def (STREAM, NAME, VALUE)
diff --git a/gcc/config/mn10200/mn10200.c b/gcc/config/mn10200/mn10200.c
index b41c61fafca..39a378d3285 100644
--- a/gcc/config/mn10200/mn10200.c
+++ b/gcc/config/mn10200/mn10200.c
@@ -22,6 +22,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "regs.h"
diff --git a/gcc/config/mn10200/mn10200.h b/gcc/config/mn10200/mn10200.h
index 793838fc531..112b90d866b 100644
--- a/gcc/config/mn10200/mn10200.h
+++ b/gcc/config/mn10200/mn10200.h
@@ -824,13 +824,7 @@ struct cum_arg { int nbytes; };
#define ASM_OUTPUT_LABELREF(FILE, NAME) \
fprintf (FILE, "_%s", (*targetm.strip_name_encoding) (NAME))
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
+#define ASM_PN_FORMAT "%s___%lu"
/* This is how we tell the assembler that two symbols have the same value. */
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index 3bad60b7475..578ba644033 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -22,6 +22,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "regs.h"
@@ -1149,7 +1151,7 @@ mask_ok_for_mem_btst (len, bit)
int len;
int bit;
{
- int mask = 0;
+ unsigned int mask = 0;
while (len > 0)
{
diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index f3cf9b639e7..73a355f2790 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -913,13 +913,7 @@ struct cum_arg {int nbytes; };
#define ASM_OUTPUT_LABELREF(FILE, NAME) \
fprintf (FILE, "_%s", (*targetm.strip_name_encoding) (NAME))
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
+#define ASM_PN_FORMAT "%s___%lu"
/* This is how we tell the assembler that two symbols have the same value. */
diff --git a/gcc/config/netbsd-aout.h b/gcc/config/netbsd-aout.h
index 7c2f86573ce..f7eb1bf1449 100644
--- a/gcc/config/netbsd-aout.h
+++ b/gcc/config/netbsd-aout.h
@@ -39,7 +39,9 @@ Boston, MA 02111-1307, USA. */
with the options for generating PIC code. */
#undef ASM_SPEC
-#define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k -K}"
+#define ASM_SPEC "%{fpic:-k} %{fPIC:-k -K}"
+
+#define AS_NEEDS_DASH_FOR_PIPED_INPUT
/* Provide a STARTFILE_SPEC appropriate for NetBSD a.out. Here we
diff --git a/gcc/config/ns32k/ns32k.c b/gcc/config/ns32k/ns32k.c
index b94765bfb3a..fba27cf8604 100644
--- a/gcc/config/ns32k/ns32k.c
+++ b/gcc/config/ns32k/ns32k.c
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
diff --git a/gcc/config/ns32k/ns32k.h b/gcc/config/ns32k/ns32k.h
index e6de13ca79c..ba53a6fc28d 100644
--- a/gcc/config/ns32k/ns32k.h
+++ b/gcc/config/ns32k/ns32k.h
@@ -810,12 +810,6 @@ __transfer_from_trampoline () \
/* Addressing modes, and classification of registers for them. */
-/* #define HAVE_POST_INCREMENT 0 */
-/* #define HAVE_POST_DECREMENT 0 */
-
-/* #define HAVE_PRE_DECREMENT 0 */
-/* #define HAVE_PRE_INCREMENT 0 */
-
/* Macros to check register numbers against specific register classes. */
/* These assume that REGNO is a hard or pseudo reg number.
@@ -1315,12 +1309,6 @@ __transfer_from_trampoline () \
/* Globalizing directive for a label. */
#define GLOBAL_ASM_OP ".globl "
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, "%s%d:\n", PREFIX, NUM)
-
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
@@ -1371,14 +1359,6 @@ __transfer_from_trampoline () \
assemble_name ((FILE), (NAME)), \
fprintf ((FILE), ",%u\n", (ROUNDED)))
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
/* Print an instruction operand X on file FILE.
CODE is the code from the %-spec that requested printing this operand;
if `%z3' was used to print operand 3, then CODE is 'z'. */
diff --git a/gcc/config/ns32k/ns32k.md b/gcc/config/ns32k/ns32k.md
index 3929eb95cc1..5d93b53d5f4 100644
--- a/gcc/config/ns32k/ns32k.md
+++ b/gcc/config/ns32k/ns32k.md
@@ -2693,7 +2693,7 @@
""
"*
{
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"LI\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"LI\",
CODE_LABEL_NUMBER (operands[1]));
return \"cased %0\";
}")
diff --git a/gcc/config/openbsd.h b/gcc/config/openbsd.h
index 1c215ebbf2d..ef12922ae2f 100644
--- a/gcc/config/openbsd.h
+++ b/gcc/config/openbsd.h
@@ -106,16 +106,12 @@ Boston, MA 02111-1307, USA. */
still uses a special flavor of gas that needs to be told when generating
pic code. */
#undef ASM_SPEC
-#define ASM_SPEC "%{fpic:-k} %{fPIC:-k -K} %|"
-
-#else
-/* Since we use gas, stdin -> - is a good idea, but we don't want to
- override native specs just for that. */
-#ifndef ASM_SPEC
-#define ASM_SPEC "%|"
-#endif
+#define ASM_SPEC "%{fpic:-k} %{fPIC:-k -K}"
#endif
+/* Since we use gas, stdin -> - is a good idea. */
+#define AS_NEEDS_DASH_FOR_PIPED_INPUT
+
/* LINK_SPEC appropriate for OpenBSD. Support for GCC options
-static, -assert, and -nostdlib. */
#undef LINK_SPEC
diff --git a/gcc/config/pa/pa-linux.h b/gcc/config/pa/pa-linux.h
index 495046e762b..a39ef318a00 100644
--- a/gcc/config/pa/pa-linux.h
+++ b/gcc/config/pa/pa-linux.h
@@ -158,7 +158,7 @@ Boston, MA 02111-1307, USA. */
/* Use the default. */
#undef ASM_OUTPUT_LABEL
-/* NOTE: ASM_OUTPUT_INTERNAL_LABEL() is defined for us by elfos.h, and
+/* NOTE: (*targetm.asm_out.internal_label)() is defined for us by elfos.h, and
does what we want (i.e. uses colons). It must be compatible with
ASM_GENERATE_INTERNAL_LABEL(), so do not define it here. */
@@ -167,6 +167,11 @@ Boston, MA 02111-1307, USA. */
/* Globalizing directive for a label. */
#define GLOBAL_ASM_OP ".globl "
+/* This definition is used inside pa.c to disable all
+ sibcall optimization, because sibcalls, stubs and
+ elf sections don't play well. */
+#define TARGET_HAS_STUBS_AND_ELF_SECTIONS 1
+
/* FIXME: Hacked from the <elfos.h> one so that we avoid multiple
labels in a function declaration (since pa.c seems determined to do
it differently) */
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 5c01a8b0b4f..ccb37d24d07 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -22,6 +22,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -117,6 +119,7 @@ static void pa_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT))
ATTRIBUTE_UNUSED;
static void pa_encode_section_info PARAMS ((tree, int));
static const char *pa_strip_name_encoding PARAMS ((const char *));
+static bool pa_function_ok_for_sibcall PARAMS ((tree, tree));
static void pa_globalize_label PARAMS ((FILE *, const char *))
ATTRIBUTE_UNUSED;
static void pa_asm_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
@@ -198,6 +201,9 @@ static size_t n_deferred_plabels = 0;
#undef TARGET_STRIP_NAME_ENCODING
#define TARGET_STRIP_NAME_ENCODING pa_strip_name_encoding
+#undef TARGET_FUNCTION_OK_FOR_SIBCALL
+#define TARGET_FUNCTION_OK_FOR_SIBCALL pa_function_ok_for_sibcall
+
#undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK pa_asm_output_mi_thunk
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
@@ -4784,7 +4790,7 @@ output_deferred_plabels (file)
/* Now output the deferred plabels. */
for (i = 0; i < n_deferred_plabels; i++)
{
- ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (deferred_plabels[i].internal_label));
+ (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (deferred_plabels[i].internal_label));
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, deferred_plabels[i].name),
TARGET_64BIT ? 8 : 4, TARGET_64BIT ? 64 : 32, 1);
}
@@ -5546,7 +5552,7 @@ output_cbranch (operands, nullify, length, negated, insn)
{
xoperands[4] = gen_label_rtx ();
output_asm_insn ("addil L'%l0-%l4,%%r1", xoperands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (xoperands[4]));
output_asm_insn ("ldo R'%l0-%l4(%%r1),%%r1", xoperands);
}
@@ -6248,7 +6254,7 @@ output_millicode_call (insn, call_dest)
{
xoperands[1] = gen_label_rtx ();
output_asm_insn ("addil L'%0-%l1,%%r1", xoperands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (xoperands[1]));
output_asm_insn ("ldo R'%0-%l1(%%r1),%%r1", xoperands);
}
@@ -6292,7 +6298,7 @@ output_millicode_call (insn, call_dest)
millicode symbol but not an arbitrary external
symbol when generating SOM output. */
xoperands[1] = gen_label_rtx ();
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (xoperands[1]));
output_asm_insn ("addil L'%0-%l1,%%r1", xoperands);
output_asm_insn ("ldo R'%0-%l1(%%r1),%%r1", xoperands);
@@ -6329,7 +6335,7 @@ output_millicode_call (insn, call_dest)
{
xoperands[1] = gen_label_rtx ();
output_asm_insn ("ldo %0-%1(%2),%2", xoperands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (xoperands[1]));
}
else
@@ -6540,7 +6546,7 @@ output_call (insn, call_dest, sibcall)
xoperands[1] = gen_label_rtx ();
output_asm_insn ("{bl|b,l} .+8,%%r1", xoperands);
output_asm_insn ("addil L'%0-%l1,%%r1", xoperands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (xoperands[1]));
output_asm_insn ("ldo R'%0-%l1(%%r1),%%r1", xoperands);
}
@@ -6667,8 +6673,8 @@ output_call (insn, call_dest, sibcall)
{
xoperands[1] = gen_label_rtx ();
output_asm_insn ("ldo %0-%1(%%r2),%%r2", xoperands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
- CODE_LABEL_NUMBER (xoperands[1]));
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
+ CODE_LABEL_NUMBER (xoperands[1]));
}
else
/* ??? This branch may not reach its target. */
@@ -6837,13 +6843,51 @@ pa_asm_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
{
data_section ();
fprintf (file, "\t.align 4\n");
- ASM_OUTPUT_INTERNAL_LABEL (file, "LTHN", current_thunk_number);
+ (*targetm.asm_out.internal_label) (file, "LTHN", current_thunk_number);
fprintf (file, "\t.word P'%s\n", target_name);
function_section (thunk_fndecl);
}
current_thunk_number++;
}
+/* Only direct calls to static functions are allowed to be sibling (tail)
+ call optimized.
+
+ This restriction is necessary because some linker generated stubs will
+ store return pointers into rp' in some cases which might clobber a
+ live value already in rp'.
+
+ In a sibcall the current function and the target function share stack
+ space. Thus if the path to the current function and the path to the
+ target function save a value in rp', they save the value into the
+ same stack slot, which has undesirable consequences.
+
+ Because of the deferred binding nature of shared libraries any function
+ with external scope could be in a different load module and thus require
+ rp' to be saved when calling that function. So sibcall optimizations
+ can only be safe for static function.
+
+ Note that GCC never needs return value relocations, so we don't have to
+ worry about static calls with return value relocations (which require
+ saving rp').
+
+ It is safe to perform a sibcall optimization when the target function
+ will never return. */
+static bool
+pa_function_ok_for_sibcall (decl, exp)
+ tree decl;
+ tree exp ATTRIBUTE_UNUSED;
+{
+#ifdef TARGET_HAS_STUBS_AND_ELF_SECTIONS
+ /* Sibcalls, stubs, and elf sections don't play well. */
+ return false;
+#endif
+ return (decl
+ && ! TARGET_PORTABLE_RUNTIME
+ && ! TARGET_64BIT
+ && ! TREE_PUBLIC (decl));
+}
+
/* Returns 1 if the 6 operands specified in OPERANDS are suitable for
use in fmpyadd instructions. */
int
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 860b7590d98..a1954e189fc 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -926,7 +926,7 @@ extern enum cmp_type hppa_branch_type;
#endif
#define FUNCTION_PROFILER(FILE, LABEL) \
- ASM_OUTPUT_INTERNAL_LABEL (FILE, FUNC_BEGIN_PROLOG_LABEL, LABEL)
+ (*targetm.asm_out.internal_label) (FILE, FUNC_BEGIN_PROLOG_LABEL, LABEL)
#define PROFILE_HOOK(label_no) hppa_profile_hook (label_no)
void hppa_profile_hook PARAMS ((int label_no));
@@ -1729,12 +1729,6 @@ do { \
fputs (xname, FILE); \
} while (0)
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- {fprintf (FILE, "%c$%s%04d\n", (PREFIX)[0], (PREFIX) + 1, NUM);}
-
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
@@ -1802,13 +1796,7 @@ do { \
assemble_name ((FILE), (NAME)); \
fprintf ((FILE), "\n\t.block %d\n", (SIZE));}
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12), \
- sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
+#define ASM_PN_FORMAT "%s___%lu"
/* All HP assemblers use "!" to separate logical lines. */
#define IS_ASM_LOGICAL_LINE_SEPARATOR(C) ((C) == '!')
@@ -1889,35 +1877,6 @@ do { \
/* The number of Pmode words for the setjmp buffer. */
#define JMP_BUF_SIZE 50
-/* Only direct calls to static functions are allowed to be sibling (tail)
- call optimized.
-
- This restriction is necessary because some linker generated stubs will
- store return pointers into rp' in some cases which might clobber a
- live value already in rp'.
-
- In a sibcall the current function and the target function share stack
- space. Thus if the path to the current function and the path to the
- target function save a value in rp', they save the value into the
- same stack slot, which has undesirable consequences.
-
- Because of the deferred binding nature of shared libraries any function
- with external scope could be in a different load module and thus require
- rp' to be saved when calling that function. So sibcall optimizations
- can only be safe for static function.
-
- Note that GCC never needs return value relocations, so we don't have to
- worry about static calls with return value relocations (which require
- saving rp').
-
- It is safe to perform a sibcall optimization when the target function
- will never return. */
-#define FUNCTION_OK_FOR_SIBCALL(DECL) \
- (DECL \
- && ! TARGET_PORTABLE_RUNTIME \
- && ! TARGET_64BIT \
- && ! TREE_PUBLIC (DECL))
-
#define PREDICATE_CODES \
{"reg_or_0_operand", {SUBREG, REG, CONST_INT}}, \
{"call_operand_address", {LABEL_REF, SYMBOL_REF, CONST_INT, \
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 640196b067d..00ea6e9b49d 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -2455,7 +2455,7 @@
output_asm_insn (\"{bl|b,l} .+8,%0\", xoperands);
output_asm_insn (\"{depi|depwi} 0,31,2,%0\", xoperands);
if (TARGET_SOM || ! TARGET_GAS)
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*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
@@ -5724,7 +5724,7 @@
xoperands[2] = gen_label_rtx ();
output_asm_insn (\"{bl|b,l} %0,%%r2\;ldo %1-%2(%%r2),%%r25\", xoperands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (xoperands[2]));
return \"\";
}"
@@ -5789,7 +5789,7 @@
output_asm_insn (\"{bl|b,l} .+8,%%r1\\n\\taddil L'%l0-%l1,%%r1\",
xoperands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (xoperands[1]));
output_asm_insn (\"ldo R'%l0-%l1(%%r1),%%r1\", xoperands);
}
@@ -6018,7 +6018,7 @@
if (TARGET_SOM || ! TARGET_GAS)
{
output_asm_insn (\"addil L%%$$dyncall-%1,%%r1\", xoperands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (xoperands[1]));
output_asm_insn (\"ldo R%%$$dyncall-%1(%%r1),%%r1\", xoperands);
}
@@ -6194,7 +6194,7 @@
if (TARGET_SOM || ! TARGET_GAS)
{
output_asm_insn (\"addil L%%$$dyncall-%1,%%r1\", xoperands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (xoperands[1]));
output_asm_insn (\"ldo R%%$$dyncall-%1(%%r1),%%r1\", xoperands);
}
diff --git a/gcc/config/pa/pa64-hpux.h b/gcc/config/pa/pa64-hpux.h
index aa7dac75382..f212b7c0e34 100644
--- a/gcc/config/pa/pa64-hpux.h
+++ b/gcc/config/pa/pa64-hpux.h
@@ -173,10 +173,6 @@ do { \
} while (0)
/* We need to use the HP style for internal labels. */
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) \
- fprintf (FILE, "%c$%s%04d\n", (PREFIX)[0], (PREFIX) + 1, NUM)
-
#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
sprintf (LABEL, "*%c$%s%04ld", (PREFIX)[0], (PREFIX) + 1, (long)(NUM))
diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c
index a7066bdffb7..d2f25ca6a29 100644
--- a/gcc/config/pdp11/pdp11.c
+++ b/gcc/config/pdp11/pdp11.c
@@ -22,6 +22,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h
index f246aa47e5c..f9eb3f0e96a 100644
--- a/gcc/config/pdp11/pdp11.h
+++ b/gcc/config/pdp11/pdp11.h
@@ -668,10 +668,8 @@ extern int may_call_alloca;
/* Addressing modes, and classification of registers for them. */
#define HAVE_POST_INCREMENT 1
-/* #define HAVE_POST_DECREMENT 0 */
#define HAVE_PRE_DECREMENT 1
-/* #define HAVE_PRE_INCREMENT 0 */
/* Macros to check register numbers against specific register classes. */
@@ -1060,12 +1058,6 @@ fprintf (FILE, "$help$: . = .+8 ; space for tmp moves!\n") \
#define USER_LABEL_PREFIX "_"
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, "%s_%d:\n", PREFIX, NUM)
-
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
@@ -1127,14 +1119,6 @@ fprintf (FILE, "$help$: . = .+8 ; space for tmp moves!\n") \
( assemble_name ((FILE), (NAME)), \
fprintf ((FILE), ":\t.=.+ %#ho\n", (unsigned short)(ROUNDED)))
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
/* Print operand X (an rtx) in assembler syntax to file FILE.
CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
For `%' followed by punctuation, CODE is the punctuation and X is null.
diff --git a/gcc/config/ptx4.h b/gcc/config/ptx4.h
index 3d8e5278567..4560b86eab3 100644
--- a/gcc/config/ptx4.h
+++ b/gcc/config/ptx4.h
@@ -93,16 +93,7 @@ Boston, MA 02111-1307, USA.
"-no_0f_fix -no_eflags_chk %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"
#endif
-/* svr4 assemblers need the `-' (indicating input from stdin) to come after
- the -o option (and its argument) for some reason. If we try to put it
- before the -o option, the assembler will try to read the file named as
- the output file in the -o option as an input file (after it has already
- written some stuff to it) and the binary stuff contained therein will
- cause totally confuse the assembler, resulting in many spurious error
- messages. */
-
-#undef ASM_FINAL_SPEC
-#define ASM_FINAL_SPEC "%{pipe:-}"
+#define AS_NEEDS_DASH_FOR_PIPED_INPUT
/* Provide a LIB_SPEC appropriate for svr4. Here we tack on the default
standard C library (unless we are building a shared library). */
diff --git a/gcc/config/romp/romp.c b/gcc/config/romp/romp.c
index 44d422a3716..dc9761c7113 100644
--- a/gcc/config/romp/romp.c
+++ b/gcc/config/romp/romp.c
@@ -23,6 +23,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
diff --git a/gcc/config/romp/romp.h b/gcc/config/romp/romp.h
index 1e3f6476d76..e659f8c8b04 100644
--- a/gcc/config/romp/romp.h
+++ b/gcc/config/romp/romp.h
@@ -834,12 +834,6 @@ struct rt_cargs {int gregs, fregs; };
/* Addressing modes, and classification of registers for them. */
-/* #define HAVE_POST_INCREMENT 0 */
-/* #define HAVE_POST_DECREMENT 0 */
-
-/* #define HAVE_PRE_DECREMENT 0 */
-/* #define HAVE_PRE_INCREMENT 0 */
-
/* Macros to check register numbers against specific register classes. */
/* These assume that REGNO is a hard or pseudo reg number.
@@ -1322,18 +1316,12 @@ struct rt_cargs {int gregs, fregs; };
#define USER_LABEL_PREFIX "_"
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, "%s%d:\n", PREFIX, NUM)
-
/* This is how to output a label for a jump table. Arguments are the same as
- for ASM_OUTPUT_INTERNAL_LABEL, except the insn for the jump table is
+ for (*targetm.asm_out.internal_label), except the insn for the jump table is
passed. */
#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \
-{ ASM_OUTPUT_ALIGN (FILE, 2); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); }
+{ ASM_OUTPUT_ALIGN (FILE, 2); (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); }
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
@@ -1392,14 +1380,6 @@ struct rt_cargs {int gregs, fregs; };
assemble_name ((FILE), (NAME)), \
fprintf ((FILE), ",%d\n", (SIZE)))
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
/* Print operand X (an rtx) in assembler syntax to file FILE.
CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
For `%' followed by punctuation, CODE is the punctuation and X is null. */
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index 73fd5beed3d..3d5d7e447b8 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -323,7 +323,7 @@ do \
assemble_name (FILE, \
XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
putc ('\n', FILE); \
- ASM_OUTPUT_INTERNAL_LABEL (FILE, "LM", sym_lineno); \
+ (*targetm.asm_out.internal_label) (FILE, "LM", sym_lineno); \
sym_lineno += 1; \
} \
while (0)
diff --git a/gcc/config/rs6000/lynx.h b/gcc/config/rs6000/lynx.h
index 7878ef94a17..9689bf150f9 100644
--- a/gcc/config/rs6000/lynx.h
+++ b/gcc/config/rs6000/lynx.h
@@ -33,7 +33,6 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_ASM_SELECT_SECTION
#undef USER_LABEL_PREFIX
#undef ASM_OUTPUT_LABELREF
-#undef ASM_OUTPUT_INTERNAL_LABEL
#undef ASM_GENERATE_INTERNAL_LABEL
#undef ASM_OUTPUT_COMMON
#undef ASM_OUTPUT_LOCAL
diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
index 03f91baf2c7..a9ea94f9e05 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -23,6 +23,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "cpplib.h"
#include "tree.h"
#include "c-pragma.h"
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 5c0ef2f6f30..27069b6f1d9 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -22,6 +22,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -165,6 +167,7 @@ struct builtin_description
const enum rs6000_builtins code;
};
+static bool rs6000_function_ok_for_sibcall PARAMS ((tree, tree));
static void rs6000_add_gc_roots PARAMS ((void));
static int num_insns_constant_wide PARAMS ((HOST_WIDE_INT));
static void validate_condition_mode
@@ -388,6 +391,9 @@ static const char alt_reg_names[][8] =
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK default_can_output_mi_thunk_no_vcall
#endif
+#undef TARGET_FUNCTION_OK_FOR_SIBCALL
+#define TARGET_FUNCTION_OK_FOR_SIBCALL rs6000_function_ok_for_sibcall
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Override command line options. Mostly we process the processor
@@ -462,6 +468,9 @@ rs6000_override_options (default_cpu)
{"405", PROCESSOR_PPC405,
MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS,
POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
+ {"405f", PROCESSOR_PPC405,
+ 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},
@@ -9510,33 +9519,34 @@ rs6000_return_addr (count, frame)
vector parameters are required to have a prototype, so the argument
type info must be available here. (The tail recursion case can work
with vector parameters, but there's no way to distinguish here.) */
-int
-function_ok_for_sibcall (fndecl)
- tree fndecl;
+static bool
+rs6000_function_ok_for_sibcall (decl, exp)
+ tree decl;
+ tree exp ATTRIBUTE_UNUSED;
{
tree type;
- if (fndecl)
+ if (decl)
{
if (TARGET_ALTIVEC_VRSAVE)
{
- for (type = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
+ for (type = TYPE_ARG_TYPES (TREE_TYPE (decl));
type; type = TREE_CHAIN (type))
{
if (TREE_CODE (TREE_VALUE (type)) == VECTOR_TYPE)
- return 0;
+ return false;
}
}
if (DEFAULT_ABI == ABI_DARWIN
- || (*targetm.binds_local_p) (fndecl))
+ || (*targetm.binds_local_p) (decl))
{
- tree attr_list = TYPE_ATTRIBUTES (TREE_TYPE (fndecl));
+ tree attr_list = TYPE_ATTRIBUTES (TREE_TYPE (decl));
if (!lookup_attribute ("longcall", attr_list)
|| lookup_attribute ("shortcall", attr_list))
- return 1;
+ return true;
}
}
- return 0;
+ return false;
}
static int
@@ -11424,7 +11434,7 @@ rs6000_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
/* Set up a TOC entry for the function. */
ASM_GENERATE_INTERNAL_LABEL (buf, "Lthunk", labelno);
toc_section ();
- ASM_OUTPUT_INTERNAL_LABEL (file, "Lthunk", labelno);
+ (*targetm.asm_out.internal_label) (file, "Lthunk", labelno);
labelno++;
if (TARGET_MINIMAL_TOC)
@@ -11747,7 +11757,7 @@ output_toc (file, x, labelno, mode)
ASM_OUTPUT_ALIGN (file, 3);
}
- ASM_OUTPUT_INTERNAL_LABEL (file, "LC", labelno);
+ (*targetm.asm_out.internal_label) (file, "LC", labelno);
/* Handle FP constants specially. Note that if we have a minimal
TOC, things we put here aren't actually in the TOC, so we can allow
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index e5e9e27cce9..9bb6373682b 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -69,6 +69,7 @@ Boston, MA 02111-1307, USA. */
%{mcpu=401: -mppc} \
%{mcpu=403: -m403} \
%{mcpu=405: -m405} \
+%{mcpu=405f: -m405} \
%{mcpu=505: -mppc} \
%{mcpu=601: -m601} \
%{mcpu=602: -mppc} \
@@ -1804,10 +1805,6 @@ typedef struct rs6000_args
argument is passed depends on whether or not it is a named argument. */
#define STRICT_ARGUMENT_NAMING 1
-/* We do not allow indirect calls to be optimized into sibling calls, nor
- do we allow calls with vector parameters. */
-#define FUNCTION_OK_FOR_SIBCALL(DECL) function_ok_for_sibcall ((DECL))
-
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. */
@@ -1933,9 +1930,6 @@ typedef struct rs6000_args
/* Addressing modes, and classification of registers for them. */
-/* #define HAVE_POST_INCREMENT 0 */
-/* #define HAVE_POST_DECREMENT 0 */
-
#define HAVE_PRE_DECREMENT 1
#define HAVE_PRE_INCREMENT 1
@@ -2801,14 +2795,6 @@ extern char rs6000_reg_names[][8]; /* register names (0 vs. %r0). */
if ((LOG) != 0) \
fprintf (FILE, "\t.align %d\n", (LOG))
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
/* Pick up the return address upon entry to a procedure. Used for
dwarf2 unwind information. This also enables the table driven
mechanism. */
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index a031a295e9b..2f11f5781cb 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -36,6 +36,7 @@
;; 16 macho_correct_pic
;; 19 movesi_from_cr
;; 20 movesi_to_cr
+;; 21 cntlz{w,d}2 count lead zero word/double word
;; Define an insn type attribute. This is used in function unit delay
;; computations.
@@ -2364,12 +2365,27 @@
(const_int 0)))]
"")
-(define_insn "ffssi2"
- [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
- (ffs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
+(define_expand "ffssi2"
+ [(set (match_dup 2)
+ (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r")))
+ (parallel [(set (match_dup 3) (and:SI (match_dup 1)
+ (match_dup 2)))
+ (clobber (scratch:CC))])
+ (set (match_dup 4) (unspec:SI [(match_dup 3)] 21))
+ (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+ (minus:SI (const_int 32) (match_dup 4)))]
""
- "neg %0,%1\;and %0,%0,%1\;{cntlz|cntlzw} %0,%0\;{sfi|subfic} %0,%0,32"
- [(set_attr "length" "16")])
+ {
+ operands[2] = gen_reg_rtx (SImode);
+ operands[3] = gen_reg_rtx (SImode);
+ operands[4] = gen_reg_rtx (SImode);
+ })
+
+(define_insn "cntlzw2"
+ [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+ (unspec:SI [(match_operand:SI 1 "gpc_reg_operand" "r")] 21))]
+ ""
+ "{cntlz|cntlzw} %0,%1")
(define_expand "mulsi3"
[(use (match_operand:SI 0 "gpc_reg_operand" ""))
@@ -6724,12 +6740,27 @@
(const_int 0)))]
"")
-(define_insn "ffsdi2"
- [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
- (ffs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))]
+(define_expand "ffsdi2"
+ [(set (match_dup 2)
+ (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r")))
+ (parallel [(set (match_dup 3) (and:DI (match_dup 1)
+ (match_dup 2)))
+ (clobber (scratch:CC))])
+ (set (match_dup 4) (unspec:DI [(match_dup 3)] 21))
+ (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+ (minus:DI (const_int 64) (match_dup 4)))]
"TARGET_POWERPC64"
- "neg %0,%1\;and %0,%0,%1\;cntlzd %0,%0\;subfic %0,%0,64"
- [(set_attr "length" "16")])
+ {
+ operands[2] = gen_reg_rtx (DImode);
+ operands[3] = gen_reg_rtx (DImode);
+ operands[4] = gen_reg_rtx (DImode);
+ })
+
+(define_insn "cntlzd2"
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+ (unspec:DI [(match_operand:DI 1 "gpc_reg_operand" "r")] 21))]
+ "TARGET_POWERPC64"
+ "cntlzd %0,%1")
(define_insn "muldi3"
[(set (match_operand:DI 0 "gpc_reg_operand" "=r")
@@ -8581,7 +8612,9 @@
int endian = (WORDS_BIG_ENDIAN == 0);
long l[2];
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_DOUBLE (rv, l);
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 68fa73f7997..b10649d904a 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -150,7 +150,6 @@ extern int g_switch_set; /* Whether -G xx was passed. */
N_("Link with libmvme.a, libc.a and crt0.o") }, \
{ "emb", 0, \
N_("Set the PPC_EMB bit in the ELF flags header") }, \
- { "vxworks", 0, N_("no description yet") }, \
{ "windiss", 0, N_("Use the WindISS simulator") }, \
{ "shlib", 0, N_("no description yet") }, \
EXTRA_SUBTARGET_SWITCHES \
@@ -458,7 +457,7 @@ toc_section () \
{ \
toc_initialized = 1; \
fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LCTOC", 0); \
+ (*targetm.asm_out.internal_label) (asm_out_file, "LCTOC", 0); \
fprintf (asm_out_file, "\t.tc "); \
ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); \
ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
@@ -603,7 +602,7 @@ extern int rs6000_pic_labelno;
{ \
char buf[256]; \
\
- ASM_OUTPUT_INTERNAL_LABEL (FILE, "LCL", rs6000_pic_labelno); \
+ (*targetm.asm_out.internal_label) (FILE, "LCL", rs6000_pic_labelno); \
\
ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); \
fprintf (FILE, "\t%s ", init_ptr); \
@@ -646,7 +645,7 @@ extern int rs6000_pic_labelno;
#define LOCAL_LABEL_PREFIX "."
#define USER_LABEL_PREFIX ""
-/* svr4.h overrides ASM_OUTPUT_INTERNAL_LABEL. */
+/* svr4.h overrides (*targetm.asm_out.internal_label). */
#define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX) \
asm_fprintf (FILE, "%L%s", PREFIX)
@@ -816,15 +815,15 @@ do { \
%{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \
%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
-%{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} \
-%{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} \
-%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
- %{mcall-freebsd: -mbig} \
- %{mcall-i960-old: -mlittle} \
- %{mcall-linux: -mbig} \
- %{mcall-gnu: -mbig} \
- %{mcall-netbsd: -mbig} \
-}}}}"
+%{memb|msdata|msdata=eabi: -memb} \
+%{mlittle|mlittle-endian:-mlittle; \
+ mbig|mbig-endian :-mbig; \
+ mcall-aixdesc | \
+ mcall-freebsd | \
+ mcall-netbsd | \
+ mcall-linux | \
+ mcall-gnu :-mbig; \
+ mcall-i960-old :-mlittle}"
#define CC1_ENDIAN_BIG_SPEC ""
@@ -839,19 +838,15 @@ do { \
/* Pass -G xxx to the compiler and set correct endian mode. */
#define CC1_SPEC "%{G*} \
-%{mlittle: %(cc1_endian_little)} %{!mlittle: %{mlittle-endian: %(cc1_endian_little)}} \
-%{mbig: %(cc1_endian_big)} %{!mbig: %{mbig-endian: %(cc1_endian_big)}} \
-%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
- %{mcall-aixdesc: -mbig %(cc1_endian_big) } \
- %{mcall-freebsd: -mbig %(cc1_endian_big) } \
- %{mcall-i960-old: -mlittle %(cc1_endian_little) } \
- %{mcall-linux: -mbig %(cc1_endian_big) } \
- %{mcall-gnu: -mbig %(cc1_endian_big) } \
- %{mcall-netbsd: -mbig %(cc1_endian_big) } \
- %{!mcall-aixdesc: %{!mcall-freebsd: %{!mcall-i960-old: %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd: \
- %(cc1_endian_default) \
- }}}}}} \
-}}}} \
+%{mlittle|mlittle-endian: %(cc1_endian_little); \
+ mbig |mbig-endian : %(cc1_endian_big); \
+ mcall-aixdesc | \
+ mcall-freebsd | \
+ mcall-netbsd | \
+ mcall-linux | \
+ mcall-gnu : -mbig %(cc1_endian_big); \
+ mcall-i960-old : -mlittle %(cc1_endian_little); \
+ : %(cc1_endian_default)} \
%{mno-sdata: -msdata=none } \
%{meabi: %{!mcall-*: -mcall-sysv }} \
%{!meabi: %{!mno-eabi: \
@@ -884,18 +879,16 @@ do { \
/* Default starting address if specified. */
#define LINK_START_SPEC "\
-%{mads: %(link_start_ads) } \
-%{myellowknife: %(link_start_yellowknife) } \
-%{mmvme: %(link_start_mvme) } \
-%{msim: %(link_start_sim) } \
-%{mwindiss: %(link_start_windiss) } \
-%{mcall-freebsd: %(link_start_freebsd) } \
-%{mcall-linux: %(link_start_linux) } \
-%{mcall-gnu: %(link_start_gnu) } \
-%{mcall-netbsd: %(link_start_netbsd) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
- %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd: \
- %{!mcall-freebsd: %(link_start_default) }}}}}}}}}"
+%{mads : %(link_start_ads) ; \
+ myellowknife : %(link_start_yellowknife) ; \
+ mmvme : %(link_start_mvme) ; \
+ msim : %(link_start_sim) ; \
+ mwindiss : %(link_start_windiss) ; \
+ mcall-freebsd: %(link_start_freebsd) ; \
+ mcall-linux : %(link_start_linux) ; \
+ mcall-gnu : %(link_start_gnu) ; \
+ mcall-netbsd : %(link_start_netbsd) ; \
+ : %(link_start_default) }"
#define LINK_START_DEFAULT_SPEC ""
@@ -943,18 +936,16 @@ do { \
/* Any specific OS flags. */
#define LINK_OS_SPEC "\
-%{mads: %(link_os_ads) } \
-%{myellowknife: %(link_os_yellowknife) } \
-%{mmvme: %(link_os_mvme) } \
-%{msim: %(link_os_sim) } \
-%{mwindiss: %(link_os_windiss) } \
-%{mcall-freebsd: %(link_os_freebsd) } \
-%{mcall-linux: %(link_os_linux) } \
-%{mcall-gnu: %(link_os_gnu) } \
-%{mcall-netbsd: %(link_os_netbsd) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
- %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
- %{!mcall-netbsd: %(link_os_default) }}}}}}}}}"
+%{mads : %(link_os_ads) ; \
+ myellowknife : %(link_os_yellowknife) ; \
+ mmvme : %(link_os_mvme) ; \
+ msim : %(link_os_sim) ; \
+ mwindiss : %(link_os_windiss) ; \
+ mcall-freebsd: %(link_os_freebsd) ; \
+ mcall-linux : %(link_os_linux) ; \
+ mcall-gnu : %(link_os_gnu) ; \
+ mcall-netbsd : %(link_os_netbsd) ; \
+ : %(link_os_default) }"
#define LINK_OS_DEFAULT_SPEC ""
@@ -966,74 +957,64 @@ do { \
/* Override rs6000.h definition. */
#undef CPP_SPEC
#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) \
-%{mads: %(cpp_os_ads) } \
-%{myellowknife: %(cpp_os_yellowknife) } \
-%{mmvme: %(cpp_os_mvme) } \
-%{msim: %(cpp_os_sim) } \
-%{mwindiss: %(cpp_os_windiss) } \
-%{mcall-freebsd: %(cpp_os_freebsd) } \
-%{mcall-linux: %(cpp_os_linux) } \
-%{mcall-gnu: %(cpp_os_gnu) } \
-%{mcall-netbsd: %(cpp_os_netbsd) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
- %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
- %{!mcall-netbsd: %(cpp_os_default) }}}}}}}}}"
+%{mads : %(cpp_os_ads) ; \
+ myellowknife : %(cpp_os_yellowknife) ; \
+ mmvme : %(cpp_os_mvme) ; \
+ msim : %(cpp_os_sim) ; \
+ mwindiss : %(cpp_os_windiss) ; \
+ mcall-freebsd: %(cpp_os_freebsd) ; \
+ mcall-linux : %(cpp_os_linux) ; \
+ mcall-gnu : %(cpp_os_gnu) ; \
+ mcall-netbsd : %(cpp_os_netbsd) ; \
+ : %(cpp_os_default) }"
#define CPP_OS_DEFAULT_SPEC ""
/* Override svr4.h definition. */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "\
-%{mads: %(startfile_ads) } \
-%{myellowknife: %(startfile_yellowknife) } \
-%{mmvme: %(startfile_mvme) } \
-%{msim: %(startfile_sim) } \
-%{mwindiss: %(startfile_windiss) } \
-%{mcall-freebsd: %(startfile_freebsd) } \
-%{mcall-linux: %(startfile_linux) } \
-%{mcall-gnu: %(startfile_gnu) } \
-%{mcall-netbsd: %(startfile_netbsd) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
- %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
- %{!mcall-netbsd: %(startfile_default) }}}}}}}}}"
+%{mads : %(startfile_ads) ; \
+ myellowknife : %(startfile_yellowknife) ; \
+ mmvme : %(startfile_mvme) ; \
+ msim : %(startfile_sim) ; \
+ mwindiss : %(startfile_windiss) ; \
+ mcall-freebsd: %(startfile_freebsd) ; \
+ mcall-linux : %(startfile_linux) ; \
+ mcall-gnu : %(startfile_gnu) ; \
+ mcall-netbsd : %(startfile_netbsd) ; \
+ : %(startfile_default) }"
#define STARTFILE_DEFAULT_SPEC ""
/* Override svr4.h definition. */
#undef LIB_SPEC
#define LIB_SPEC "\
-%{mads: %(lib_ads) } \
-%{myellowknife: %(lib_yellowknife) } \
-%{mmvme: %(lib_mvme) } \
-%{msim: %(lib_sim) } \
-%{mwindiss: %(lib_windiss) } \
-%{mcall-freebsd: %(lib_freebsd) } \
-%{mcall-linux: %(lib_linux) } \
-%{mcall-gnu: %(lib_gnu) } \
-%{mcall-netbsd: %(lib_netbsd) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
- %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
- %{!mcall-netbsd: %(lib_default) }}}}}}}}}"
+%{mads : %(lib_ads) ; \
+ myellowknife : %(lib_yellowknife) ; \
+ mmvme : %(lib_mvme) ; \
+ msim : %(lib_sim) ; \
+ mwindiss : %(lib_windiss) ; \
+ mcall-freebsd: %(lib_freebsd) ; \
+ mcall-linux : %(lib_linux) ; \
+ mcall-gnu : %(lib_gnu) ; \
+ mcall-netbsd : %(lib_netbsd) ; \
+ : %(lib_default) }"
#define LIB_DEFAULT_SPEC ""
/* Override svr4.h definition. */
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "\
-%{mads: crtsavres.o%s %(endfile_ads)} \
-%{myellowknife: crtsavres.o%s %(endfile_yellowknife)} \
-%{mmvme: crtsavres.o%s %(endfile_mvme)} \
-%{msim: crtsavres.o%s %(endfile_sim)} \
-%{mwindiss: %(endfile_windiss)} \
-%{mcall-freebsd: crtsavres.o%s %(endfile_freebsd) } \
-%{mcall-linux: crtsavres.o%s %(endfile_linux) } \
-%{mcall-gnu: crtsavres.o%s %(endfile_gnu) } \
-%{mcall-netbsd: crtsavres.o%s %(endfile_netbsd) } \
-%{mvxworks: crtsavres.o%s %(endfile_vxworks) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
- %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
- %{!mcall-netbsd: %{!mvxworks: %(crtsavres_default) \
- %(endfile_default) }}}}}}}}}}"
+%{mads : crtsavres.o%s %(endfile_ads) ; \
+ myellowknife : crtsavres.o%s %(endfile_yellowknife) ; \
+ mmvme : crtsavres.o%s %(endfile_mvme) ; \
+ msim : crtsavres.o%s %(endfile_sim) ; \
+ mwindiss : %(endfile_windiss) ; \
+ mcall-freebsd: crtsavres.o%s %(endfile_freebsd) ; \
+ mcall-linux : crtsavres.o%s %(endfile_linux) ; \
+ mcall-gnu : crtsavres.o%s %(endfile_gnu) ; \
+ mcall-netbsd : crtsavres.o%s %(endfile_netbsd) ; \
+ : %(crtsavres_default) %(endfile_default) }"
#define CRTSAVRES_DEFAULT_SPEC "crtsavres.o%s"
@@ -1205,48 +1186,6 @@ ncrtn.o%s"
#define CPP_OS_NETBSD_SPEC "\
-D__powerpc__ -D__NetBSD__ -D__ELF__ -D__KPRINTF_ATTRIBUTE__"
-/* VxWorks support. */
-/* VxWorks does all the library stuff itself. */
-#define LIB_VXWORKS_SPEC ""
-
-/* VxWorks provides the functionality of crt0.o and friends itself. */
-
-#define STARTFILE_VXWORKS_SPEC ""
-
-#define ENDFILE_VXWORKS_SPEC ""
-
-/* Because it uses ld -r, vxworks has no start/end files, nor starting
- address. */
-
-#define LINK_START_VXWORKS_SPEC ""
-
-#define LINK_OS_VXWORKS_SPEC "-r"
-
-#define CPP_OS_VXWORKS_SPEC "\
--DCPU_FAMILY=PPC \
-%{!mcpu*: \
- %{mpowerpc*: -DCPU=PPC603} \
- %{!mno-powerpc: -DCPU=PPC603}} \
-%{mcpu=powerpc: -DCPU=PPC603} \
-%{mcpu=401: -DCPU=PPC403} \
-%{mcpu=403: -DCPU=PPC403} \
-%{mcpu=405: -DCPU=PPC405} \
-%{mcpu=601: -DCPU=PPC601} \
-%{mcpu=602: -DCPU=PPC603} \
-%{mcpu=603: -DCPU=PPC603} \
-%{mcpu=603e: -DCPU=PPC603} \
-%{mcpu=ec603e: -DCPU=PPC603} \
-%{mcpu=604: -DCPU=PPC604} \
-%{mcpu=604e: -DCPU=PPC604} \
-%{mcpu=620: -DCPU=PPC604} \
-%{mcpu=740: -DCPU=PPC603} \
-%{mcpu=7450: -DCPU=PPC603} \
-%{mcpu=750: -DCPU=PPC603} \
-%{mcpu=801: -DCPU=PPC603} \
-%{mcpu=821: -DCPU=PPC603} \
-%{mcpu=823: -DCPU=PPC603} \
-%{mcpu=860: -DCPU=PPC603}"
-
/* WindISS support. */
#define LIB_WINDISS_SPEC "--start-group -li -lcfp -lwindiss -lram -limpl -limpfp --end-group"
@@ -1280,7 +1219,6 @@ ncrtn.o%s"
{ "lib_gnu", LIB_GNU_SPEC }, \
{ "lib_linux", LIB_LINUX_SPEC }, \
{ "lib_netbsd", LIB_NETBSD_SPEC }, \
- { "lib_vxworks", LIB_VXWORKS_SPEC }, \
{ "lib_windiss", LIB_WINDISS_SPEC }, \
{ "lib_default", LIB_DEFAULT_SPEC }, \
{ "startfile_ads", STARTFILE_ADS_SPEC }, \
@@ -1291,7 +1229,6 @@ ncrtn.o%s"
{ "startfile_gnu", STARTFILE_GNU_SPEC }, \
{ "startfile_linux", STARTFILE_LINUX_SPEC }, \
{ "startfile_netbsd", STARTFILE_NETBSD_SPEC }, \
- { "startfile_vxworks", STARTFILE_VXWORKS_SPEC }, \
{ "startfile_windiss", STARTFILE_WINDISS_SPEC }, \
{ "startfile_default", STARTFILE_DEFAULT_SPEC }, \
{ "endfile_ads", ENDFILE_ADS_SPEC }, \
@@ -1302,7 +1239,6 @@ ncrtn.o%s"
{ "endfile_gnu", ENDFILE_GNU_SPEC }, \
{ "endfile_linux", ENDFILE_LINUX_SPEC }, \
{ "endfile_netbsd", ENDFILE_NETBSD_SPEC }, \
- { "endfile_vxworks", ENDFILE_VXWORKS_SPEC }, \
{ "endfile_windiss", ENDFILE_WINDISS_SPEC }, \
{ "endfile_default", ENDFILE_DEFAULT_SPEC }, \
{ "link_path", LINK_PATH_SPEC }, \
@@ -1317,7 +1253,6 @@ 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_vxworks", LINK_START_VXWORKS_SPEC }, \
{ "link_start_windiss", LINK_START_WINDISS_SPEC }, \
{ "link_start_default", LINK_START_DEFAULT_SPEC }, \
{ "link_os", LINK_OS_SPEC }, \
@@ -1329,7 +1264,6 @@ 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_vxworks", LINK_OS_VXWORKS_SPEC }, \
{ "link_os_windiss", LINK_OS_WINDISS_SPEC }, \
{ "link_os_default", LINK_OS_DEFAULT_SPEC }, \
{ "cc1_endian_big", CC1_ENDIAN_BIG_SPEC }, \
@@ -1343,7 +1277,6 @@ 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_vxworks", CPP_OS_VXWORKS_SPEC }, \
{ "cpp_os_windiss", CPP_OS_WINDISS_SPEC }, \
{ "cpp_os_default", CPP_OS_DEFAULT_SPEC },
diff --git a/gcc/config/rs6000/t-rs6000-c-rule b/gcc/config/rs6000/t-rs6000-c-rule
index a768fb5b0ea..b9a92dd9f83 100644
--- a/gcc/config/rs6000/t-rs6000-c-rule
+++ b/gcc/config/rs6000/t-rs6000-c-rule
@@ -1,4 +1,5 @@
rs6000-c.o: $(srcdir)/config/rs6000/rs6000-c.c \
$(srcdir)/config/rs6000/rs6000-protos.h \
- $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(CPPLIB_H) $(TM_P_H) c-pragma.h errors.h
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
+ $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(CPPLIB_H) \
+ $(TM_P_H) c-pragma.h errors.h coretypes.h $(TM_H)
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/rs6000/rs6000-c.c
diff --git a/gcc/config/rs6000/t-vxworks b/gcc/config/rs6000/t-vxworks
new file mode 100644
index 00000000000..e89e47b8d09
--- /dev/null
+++ b/gcc/config/rs6000/t-vxworks
@@ -0,0 +1,10 @@
+# Multilibs for VxWorks.
+
+MULTILIB_OPTIONS = t403/t405/t440/t603/t604/t860
+MULTILIB_DIRNAMES = PPC403gnu PPC405gnu PPC440gnu \
+ PPC603gnu PPC604gnu PPC860gnu
+
+MULTILIB_MATCHES = t604=
+
+# Put vxlib.c back in LIB2FUNCS_EXTRA (t-ppccomm clobbers it).
+LIB2FUNCS_EXTRA += $(srcdir)/config/vxlib.c
diff --git a/gcc/config/rs6000/vxppc.h b/gcc/config/rs6000/vxppc.h
deleted file mode 100644
index 91250a68909..00000000000
--- a/gcc/config/rs6000/vxppc.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Definitions of target machine for GNU compiler. Vxworks PowerPC version.
- Copyright (C) 1996, 2000 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. */
-
-/* This file just exists to give specs for the PowerPC running on VxWorks. */
-
-/* Reset defaults */
-#undef CPP_OS_DEFAULT_SPEC
-#define CPP_OS_DEFAULT_SPEC "%(cpp_os_vxworks)"
-
-#undef LIB_DEFAULT_SPEC
-#define LIB_DEFAULT_SPEC "%(lib_vxworks)"
-
-#undef STARTFILE_DEFAULT_SPEC
-#define STARTFILE_DEFAULT_SPEC "%(startfile_vxworks)"
-
-#undef ENDFILE_DEFAULT_SPEC
-#define ENDFILE_DEFAULT_SPEC "%(endfile_vxworks)"
-
-#undef LINK_START_DEFAULT_SPEC
-#define LINK_START_DEFAULT_SPEC "%(link_start_vxworks)"
-
-#undef LINK_OS_DEFAULT_SPEC
-#define LINK_OS_DEFAULT_SPEC "%(link_os_vxworks)"
-
-#undef TARGET_OS_CPP_BUILTINS
-#define TARGET_OS_CPP_BUILTINS() \
- do \
- { \
- builtin_define ("__vxworks"); \
- builtin_define ("__vxworks__"); \
- builtin_assert ("system=vxworks"); \
- builtin_assert ("system=embedded"); \
- builtin_assert ("cpu=powerpc"); \
- builtin_assert ("machine=powerpc"); \
- } \
- while (0)
-
-/* We use stabs-in-elf for debugging */
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/gcc/config/rs6000/vxworks.h b/gcc/config/rs6000/vxworks.h
new file mode 100644
index 00000000000..dddd26d8d5e
--- /dev/null
+++ b/gcc/config/rs6000/vxworks.h
@@ -0,0 +1,81 @@
+/* Definitions of target machine for GNU compiler. Vxworks PowerPC version.
+ Copyright (C) 1996, 2000, 2002 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. */
+
+/* N.B. Only big endian PPC is supported by VxWorks. */
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES \
+ "-D__vxworks -D__vxworks__ -D_BIG_ENDIAN -D__BIG_ENDIAN__"
+
+/* We have to kill off the entire specs set created by rs6000/sysv4.h
+ and substitute our own set. The top level vxworks.h has done some
+ of this for us. */
+
+#undef SUBTARGET_EXTRA_SPECS
+#undef CPP_SPEC
+#undef CC1_SPEC
+#undef ASM_SPEC
+
+#define SUBTARGET_EXTRA_SPECS /* none needed */
+
+#define CPP_SPEC \
+"-DCPU_FAMILY=PPC -D__ppc -D__EABI__ -D__ELF__ \
+ %{t403: -DCPU=PPC403 -D_SOFT_FLOAT ; \
+ t405: -DCPU=PPC405 -D_SOFT_FLOAT ; \
+ t440: -DCPU=PPC440 -D_SOFT_FLOAT ; \
+ t603: -DCPU=PPC603 ; \
+ t604: -DCPU=PPC604 ; \
+ t860: -DCPU=PPC860 -D_SOFT_FLOAT ; \
+ : -DCPU=PPC604} \
+ %{!msoft-float:-D__hardfp} \
+ %{fpic: -D__PIC__=1 -D__pic__=1 ; \
+ fPIC: -D__PIC__=2 -D__pic__=2 } \
+ %(cpp_cpu)"
+
+/* N.B. GCC does not currently support the 440 processor as distinct
+ from the 405 series. */
+#define CC1_SPEC \
+"%{t403: -mcpu=403 -mstrict-align ; \
+ t405: -mcpu=405 -mstrict-align ; \
+ t440: -mcpu=405 -mstrict-align ; \
+ t603: -mcpu=603 -mstrict-align ; \
+ t604: -mcpu=604 -mstrict-align ; \
+ t860: -mcpu=860 ; \
+ : -mcpu=604 -mstrict-align } \
+ %{G*} %{mno-sdata:-msdata=none} %{msdata:-msdata=default} \
+ %{mlittle|mlittle-endian:-mstrict-align} \
+ %{profile: -p} \
+ %{fvec:-maltivec} %{fvec-eabi:-maltivec -mabi=altivec}"
+
+#define ASM_SPEC "%(asm_cpu) \
+%{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \
+%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
+%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} -mbig"
+
+#undef MULTILIB_DEFAULTS
+#define MULTILIB_DEFAULTS { "t604" }
+
+/* We can't use .ctors/.dtors sections. */
+#undef TARGET_ASM_OUTPUT_CONSTRUCTOR
+#undef TARGET_ASM_OUTPUT_DESTRUCTOR
+
+/* Nor sdata. */
+#undef SDATA_DEFAULT_SIZE
+#define SDATA_DEFAULT_SIZE 0
diff --git a/gcc/config/rs6000/xcoff.h b/gcc/config/rs6000/xcoff.h
index 21d74a9e616..64a0dcd45db 100644
--- a/gcc/config/rs6000/xcoff.h
+++ b/gcc/config/rs6000/xcoff.h
@@ -325,12 +325,6 @@ toc_section () \
} \
}
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, "%s..%u:\n", (PREFIX), (unsigned) (NUM))
-
/* This is how to output an internal label prefix. rs6000.c uses this
when generating traceback tables. */
@@ -338,11 +332,11 @@ toc_section () \
fprintf (FILE, "%s..", PREFIX)
/* This is how to output a label for a jump table. Arguments are the same as
- for ASM_OUTPUT_INTERNAL_LABEL, except the insn for the jump table is
+ for (*targetm.asm_out.internal_label), except the insn for the jump table is
passed. */
#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \
-{ ASM_OUTPUT_ALIGN (FILE, 2); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); }
+{ ASM_OUTPUT_ALIGN (FILE, 2); (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); }
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 3f6ec452b1c..5e4741e86be 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -22,6 +22,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "tm_p.h"
@@ -5566,7 +5568,7 @@ s390_function_profiler (file, labelno)
output_asm_insn ("bras\t%2,%l6", op);
output_asm_insn (".long\t%4", op);
output_asm_insn (".long\t%3", op);
- ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (op[6]));
+ (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (op[6]));
output_asm_insn ("l\t%0,0(%2)", op);
output_asm_insn ("l\t%2,4(%2)", op);
output_asm_insn ("basr\t%0,%0", op);
@@ -5579,10 +5581,10 @@ s390_function_profiler (file, labelno)
output_asm_insn ("st\t%0,%1", op);
output_asm_insn ("bras\t%2,%l6", op);
- ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (op[5]));
+ (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (op[5]));
output_asm_insn (".long\t%4-%l5", op);
output_asm_insn (".long\t%3-%l5", op);
- ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (op[6]));
+ (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (op[6]));
output_asm_insn ("lr\t%0,%2", op);
output_asm_insn ("a\t%0,0(%2)", op);
output_asm_insn ("a\t%2,4(%2)", op);
@@ -5728,16 +5730,19 @@ s390_output_mi_thunk (file, thunk, delta, vcall_offset, function)
if (op[5])
{
output_asm_insn (".align\t4", op);
- ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (op[5]));
+ (*targetm.asm_out.internal_label) (file, "L",
+ CODE_LABEL_NUMBER (op[5]));
}
if (op[6])
{
- ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (op[6]));
+ (*targetm.asm_out.internal_label) (file, "L",
+ CODE_LABEL_NUMBER (op[6]));
output_asm_insn (".long\t%2", op);
}
if (op[7])
{
- ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (op[7]));
+ (*targetm.asm_out.internal_label) (file, "L",
+ CODE_LABEL_NUMBER (op[7]));
output_asm_insn (".long\t%3", op);
}
}
@@ -5750,7 +5755,8 @@ s390_output_mi_thunk (file, thunk, delta, vcall_offset, function)
{
op[5] = gen_label_rtx ();
output_asm_insn ("basr\t%4,0", op);
- ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (op[5]));
+ (*targetm.asm_out.internal_label) (file, "L",
+ CODE_LABEL_NUMBER (op[5]));
}
/* Add DELTA to this pointer. */
@@ -5793,7 +5799,8 @@ s390_output_mi_thunk (file, thunk, delta, vcall_offset, function)
Re-setup the base pointer (with a different base). */
op[5] = gen_label_rtx ();
output_asm_insn ("basr\t%4,0", op);
- ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (op[5]));
+ (*targetm.asm_out.internal_label) (file, "L",
+ CODE_LABEL_NUMBER (op[5]));
}
/* Jump to target. */
@@ -5806,7 +5813,7 @@ s390_output_mi_thunk (file, thunk, delta, vcall_offset, function)
/* Output literal pool. */
output_asm_insn (".align\t4", op);
- ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (op[8]));
+ (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (op[8]));
if (!flag_pic)
output_asm_insn (".long\t%0", op);
else
@@ -5814,12 +5821,14 @@ s390_output_mi_thunk (file, thunk, delta, vcall_offset, function)
if (op[6])
{
- ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (op[6]));
+ (*targetm.asm_out.internal_label) (file, "L",
+ CODE_LABEL_NUMBER (op[6]));
output_asm_insn (".long\t%2", op);
}
if (op[7])
{
- ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (op[7]));
+ (*targetm.asm_out.internal_label) (file, "L",
+ CODE_LABEL_NUMBER (op[7]));
output_asm_insn (".long\t%3", op);
}
}
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index 23721588c0f..6d8943e760d 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -926,13 +926,6 @@ extern int flag_pic;
#define ASM_OUTPUT_SKIP(FILE, SIZE) \
fprintf ((FILE), "\t.set\t.,.+%u\n", (SIZE))
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
- ((OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
/* The LOCAL_LABEL_PREFIX variable is used by dbxelf.h. */
#define LOCAL_LABEL_PREFIX "."
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 197aa67ebcb..4767ebbdaf5 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -5065,7 +5065,7 @@
output_asm_insn (\"lcr\\t%N0,%N1\", operands);
output_asm_insn (\"je\\t%l0\", xop);
output_asm_insn (\"bctr\\t%0,0\", operands);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (xop[0]));
return \"\";
}"
diff --git a/gcc/config/sh/coff.h b/gcc/config/sh/coff.h
index 56399ae630b..4d6443e0209 100644
--- a/gcc/config/sh/coff.h
+++ b/gcc/config/sh/coff.h
@@ -50,10 +50,6 @@ Boston, MA 02111-1307, USA. */
#define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
sprintf ((STRING), "*%s%s%ld", LOCAL_LABEL_PREFIX, (PREFIX), (long)(NUM))
-/* Output an internal label definition. */
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- asm_fprintf ((FILE), "%L%s%d:\n", (PREFIX), (NUM))
-
/* This is how to output an assembler line
that says to advance the location counter by SIZE bytes. */
diff --git a/gcc/config/sh/elf.h b/gcc/config/sh/elf.h
index 1c3e3c7a4a3..858adb1d2c4 100644
--- a/gcc/config/sh/elf.h
+++ b/gcc/config/sh/elf.h
@@ -92,10 +92,6 @@ Boston, MA 02111-1307, USA. */
#define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
sprintf ((STRING), "*%s%s%ld", LOCAL_LABEL_PREFIX, (PREFIX), (long)(NUM))
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- asm_fprintf ((FILE), "%L%s%d:\n", (PREFIX), (NUM))
-
#undef ASM_OUTPUT_SOURCE_LINE
#define ASM_OUTPUT_SOURCE_LINE(file, line) \
do \
diff --git a/gcc/config/sh/lib1funcs.asm b/gcc/config/sh/lib1funcs.asm
index f37b5437293..77bb48a9128 100644
--- a/gcc/config/sh/lib1funcs.asm
+++ b/gcc/config/sh/lib1funcs.asm
@@ -38,9 +38,14 @@ Boston, MA 02111-1307, USA. */
amylaar@cygnus.com */
#ifdef __ELF__
-#define LOCAL(X) .L_##X
+#define LOCAL(X) .L_##X
+#define FUNC(X) .type X,@function
+#define ENDFUNC0(X) .Lfe_##X: .size X,.Lfe_##X-X
+#define ENDFUNC(X) ENDFUNC0(X)
#else
-#define LOCAL(X) L_##X
+#define LOCAL(X) L_##X
+#define FUNC(X)
+#define ENDFUNC(X)
#endif
#define CONCAT(A,B) A##B
@@ -87,6 +92,40 @@ Boston, MA 02111-1307, USA. */
.global GLOBAL(ashiftrt_r4_31)
.global GLOBAL(ashiftrt_r4_32)
+ FUNC(GLOBAL(ashiftrt_r4_0))
+ FUNC(GLOBAL(ashiftrt_r4_1))
+ FUNC(GLOBAL(ashiftrt_r4_2))
+ FUNC(GLOBAL(ashiftrt_r4_3))
+ FUNC(GLOBAL(ashiftrt_r4_4))
+ FUNC(GLOBAL(ashiftrt_r4_5))
+ FUNC(GLOBAL(ashiftrt_r4_6))
+ FUNC(GLOBAL(ashiftrt_r4_7))
+ FUNC(GLOBAL(ashiftrt_r4_8))
+ FUNC(GLOBAL(ashiftrt_r4_9))
+ FUNC(GLOBAL(ashiftrt_r4_10))
+ FUNC(GLOBAL(ashiftrt_r4_11))
+ FUNC(GLOBAL(ashiftrt_r4_12))
+ FUNC(GLOBAL(ashiftrt_r4_13))
+ FUNC(GLOBAL(ashiftrt_r4_14))
+ FUNC(GLOBAL(ashiftrt_r4_15))
+ FUNC(GLOBAL(ashiftrt_r4_16))
+ FUNC(GLOBAL(ashiftrt_r4_17))
+ FUNC(GLOBAL(ashiftrt_r4_18))
+ FUNC(GLOBAL(ashiftrt_r4_19))
+ FUNC(GLOBAL(ashiftrt_r4_20))
+ FUNC(GLOBAL(ashiftrt_r4_21))
+ FUNC(GLOBAL(ashiftrt_r4_22))
+ FUNC(GLOBAL(ashiftrt_r4_23))
+ FUNC(GLOBAL(ashiftrt_r4_24))
+ FUNC(GLOBAL(ashiftrt_r4_25))
+ FUNC(GLOBAL(ashiftrt_r4_26))
+ FUNC(GLOBAL(ashiftrt_r4_27))
+ FUNC(GLOBAL(ashiftrt_r4_28))
+ FUNC(GLOBAL(ashiftrt_r4_29))
+ FUNC(GLOBAL(ashiftrt_r4_30))
+ FUNC(GLOBAL(ashiftrt_r4_31))
+ FUNC(GLOBAL(ashiftrt_r4_32))
+
.align 1
GLOBAL(ashiftrt_r4_32):
GLOBAL(ashiftrt_r4_31):
@@ -166,6 +205,40 @@ GLOBAL(ashiftrt_r4_1):
GLOBAL(ashiftrt_r4_0):
rts
nop
+
+ ENDFUNC(GLOBAL(ashiftrt_r4_0))
+ ENDFUNC(GLOBAL(ashiftrt_r4_1))
+ ENDFUNC(GLOBAL(ashiftrt_r4_2))
+ ENDFUNC(GLOBAL(ashiftrt_r4_3))
+ ENDFUNC(GLOBAL(ashiftrt_r4_4))
+ ENDFUNC(GLOBAL(ashiftrt_r4_5))
+ ENDFUNC(GLOBAL(ashiftrt_r4_6))
+ ENDFUNC(GLOBAL(ashiftrt_r4_7))
+ ENDFUNC(GLOBAL(ashiftrt_r4_8))
+ ENDFUNC(GLOBAL(ashiftrt_r4_9))
+ ENDFUNC(GLOBAL(ashiftrt_r4_10))
+ ENDFUNC(GLOBAL(ashiftrt_r4_11))
+ ENDFUNC(GLOBAL(ashiftrt_r4_12))
+ ENDFUNC(GLOBAL(ashiftrt_r4_13))
+ ENDFUNC(GLOBAL(ashiftrt_r4_14))
+ ENDFUNC(GLOBAL(ashiftrt_r4_15))
+ ENDFUNC(GLOBAL(ashiftrt_r4_16))
+ ENDFUNC(GLOBAL(ashiftrt_r4_17))
+ ENDFUNC(GLOBAL(ashiftrt_r4_18))
+ ENDFUNC(GLOBAL(ashiftrt_r4_19))
+ ENDFUNC(GLOBAL(ashiftrt_r4_20))
+ ENDFUNC(GLOBAL(ashiftrt_r4_21))
+ ENDFUNC(GLOBAL(ashiftrt_r4_22))
+ ENDFUNC(GLOBAL(ashiftrt_r4_23))
+ ENDFUNC(GLOBAL(ashiftrt_r4_24))
+ ENDFUNC(GLOBAL(ashiftrt_r4_25))
+ ENDFUNC(GLOBAL(ashiftrt_r4_26))
+ ENDFUNC(GLOBAL(ashiftrt_r4_27))
+ ENDFUNC(GLOBAL(ashiftrt_r4_28))
+ ENDFUNC(GLOBAL(ashiftrt_r4_29))
+ ENDFUNC(GLOBAL(ashiftrt_r4_30))
+ ENDFUNC(GLOBAL(ashiftrt_r4_31))
+ ENDFUNC(GLOBAL(ashiftrt_r4_32))
#endif
#ifdef L_ashiftrt_n
@@ -188,6 +261,7 @@ GLOBAL(ashiftrt_r4_0):
!
.global GLOBAL(ashrsi3)
+ FUNC(GLOBAL(ashrsi3))
.align 2
GLOBAL(ashrsi3):
mov #31,r0
@@ -315,6 +389,7 @@ LOCAL(ashrsi3_0):
rts
nop
+ ENDFUNC(GLOBAL(ashrsi3))
#endif
#ifdef L_ashiftlt
@@ -336,6 +411,7 @@ LOCAL(ashrsi3_0):
! (none)
!
.global GLOBAL(ashlsi3)
+ FUNC(GLOBAL(ashlsi3))
.align 2
GLOBAL(ashlsi3):
mov #31,r0
@@ -472,6 +548,7 @@ LOCAL(ashlsi3_0):
rts
nop
+ ENDFUNC(GLOBAL(ashlsi3))
#endif
#ifdef L_lshiftrt
@@ -493,6 +570,7 @@ LOCAL(ashlsi3_0):
! (none)
!
.global GLOBAL(lshrsi3)
+ FUNC(GLOBAL(lshrsi3))
.align 2
GLOBAL(lshrsi3):
mov #31,r0
@@ -629,6 +707,7 @@ LOCAL(lshrsi3_0):
rts
nop
+ ENDFUNC(GLOBAL(lshrsi3))
#endif
#ifdef L_movstr
@@ -645,76 +724,113 @@ done:
add #64,r4
.align 4
.global GLOBAL(movstrSI64)
+ FUNC(GLOBAL(movstrSI64))
GLOBAL(movstrSI64):
mov.l @(60,r5),r0
mov.l r0,@(60,r4)
.global GLOBAL(movstrSI60)
+ FUNC(GLOBAL(movstrSI60))
GLOBAL(movstrSI60):
mov.l @(56,r5),r0
mov.l r0,@(56,r4)
.global GLOBAL(movstrSI56)
+ FUNC(GLOBAL(movstrSI56))
GLOBAL(movstrSI56):
mov.l @(52,r5),r0
mov.l r0,@(52,r4)
.global GLOBAL(movstrSI52)
+ FUNC(GLOBAL(movstrSI52))
GLOBAL(movstrSI52):
mov.l @(48,r5),r0
mov.l r0,@(48,r4)
.global GLOBAL(movstrSI48)
+ FUNC(GLOBAL(movstrSI48))
GLOBAL(movstrSI48):
mov.l @(44,r5),r0
mov.l r0,@(44,r4)
.global GLOBAL(movstrSI44)
+ FUNC(GLOBAL(movstrSI44))
GLOBAL(movstrSI44):
mov.l @(40,r5),r0
mov.l r0,@(40,r4)
.global GLOBAL(movstrSI40)
+ FUNC(GLOBAL(movstrSI40))
GLOBAL(movstrSI40):
mov.l @(36,r5),r0
mov.l r0,@(36,r4)
.global GLOBAL(movstrSI36)
+ FUNC(GLOBAL(movstrSI36))
GLOBAL(movstrSI36):
mov.l @(32,r5),r0
mov.l r0,@(32,r4)
.global GLOBAL(movstrSI32)
+ FUNC(GLOBAL(movstrSI32))
GLOBAL(movstrSI32):
mov.l @(28,r5),r0
mov.l r0,@(28,r4)
.global GLOBAL(movstrSI28)
+ FUNC(GLOBAL(movstrSI28))
GLOBAL(movstrSI28):
mov.l @(24,r5),r0
mov.l r0,@(24,r4)
.global GLOBAL(movstrSI24)
+ FUNC(GLOBAL(movstrSI24))
GLOBAL(movstrSI24):
mov.l @(20,r5),r0
mov.l r0,@(20,r4)
.global GLOBAL(movstrSI20)
+ FUNC(GLOBAL(movstrSI20))
GLOBAL(movstrSI20):
mov.l @(16,r5),r0
mov.l r0,@(16,r4)
.global GLOBAL(movstrSI16)
+ FUNC(GLOBAL(movstrSI16))
GLOBAL(movstrSI16):
mov.l @(12,r5),r0
mov.l r0,@(12,r4)
.global GLOBAL(movstrSI12)
+ FUNC(GLOBAL(movstrSI12))
GLOBAL(movstrSI12):
mov.l @(8,r5),r0
mov.l r0,@(8,r4)
.global GLOBAL(movstrSI8)
+ FUNC(GLOBAL(movstrSI8))
GLOBAL(movstrSI8):
mov.l @(4,r5),r0
mov.l r0,@(4,r4)
.global GLOBAL(movstrSI4)
+ FUNC(GLOBAL(movstrSI4))
GLOBAL(movstrSI4):
mov.l @(0,r5),r0
mov.l r0,@(0,r4)
+ .global GLOBAL(movstrSI0)
+ FUNC(GLOBAL(movstrSI0))
GLOBAL(movstrSI0):
rts
nop
+ ENDFUNC(GLOBAL(movstrSI64))
+ ENDFUNC(GLOBAL(movstrSI60))
+ ENDFUNC(GLOBAL(movstrSI56))
+ ENDFUNC(GLOBAL(movstrSI52))
+ ENDFUNC(GLOBAL(movstrSI48))
+ ENDFUNC(GLOBAL(movstrSI44))
+ ENDFUNC(GLOBAL(movstrSI40))
+ ENDFUNC(GLOBAL(movstrSI36))
+ ENDFUNC(GLOBAL(movstrSI32))
+ ENDFUNC(GLOBAL(movstrSI28))
+ ENDFUNC(GLOBAL(movstrSI24))
+ ENDFUNC(GLOBAL(movstrSI20))
+ ENDFUNC(GLOBAL(movstrSI16))
+ ENDFUNC(GLOBAL(movstrSI12))
+ ENDFUNC(GLOBAL(movstrSI8))
+ ENDFUNC(GLOBAL(movstrSI4))
+ ENDFUNC(GLOBAL(movstrSI0))
+
.align 4
.global GLOBAL(movstr)
+ FUNC(GLOBAL(movstr))
GLOBAL(movstr):
mov.l @(60,r5),r0
mov.l r0,@(60,r4)
@@ -771,6 +887,8 @@ GLOBAL(movstr):
add #64,r5
bra GLOBAL(movstr)
add #64,r4
+
+ FUNC(GLOBAL(movstr))
#endif
#ifdef L_movstr_i4
@@ -779,6 +897,10 @@ GLOBAL(movstr):
.global GLOBAL(movstr_i4_odd)
.global GLOBAL(movstrSI12_i4)
+ FUNC(GLOBAL(movstr_i4_even))
+ FUNC(GLOBAL(movstr_i4_odd))
+ FUNC(GLOBAL(movstrSI12_i4))
+
.p2align 5
L_movstr_2mod4_end:
mov.l r0,@(16,r4)
@@ -787,6 +909,11 @@ L_movstr_2mod4_end:
.p2align 2
+GLOBAL(movstr_i4_even):
+ mov.l @r5+,r0
+ bra L_movstr_start_even
+ mov.l @r5+,r1
+
GLOBAL(movstr_i4_odd):
mov.l @r5+,r1
add #-4,r4
@@ -813,10 +940,8 @@ L_movstr_start_even:
rts
mov.l r3,@(12,r4)
-GLOBAL(movstr_i4_even):
- mov.l @r5+,r0
- bra L_movstr_start_even
- mov.l @r5+,r1
+ ENDFUNC(GLOBAL(movstr_i4_even))
+ ENDFUNC(GLOBAL(movstr_i4_odd))
.p2align 4
GLOBAL(movstrSI12_i4):
@@ -827,12 +952,15 @@ GLOBAL(movstrSI12_i4):
mov.l r1,@(4,r4)
rts
mov.l r2,@(8,r4)
+
+ ENDFUNC(GLOBAL(movstrSI12_i4))
#endif
#ifdef L_mulsi3
.global GLOBAL(mulsi3)
+ FUNC(GLOBAL(mulsi3))
! r4 = aabb
! r5 = ccdd
@@ -865,7 +993,7 @@ hiset: sts macl,r0 ! r0 = bb*dd
rts
add r2,r0
-
+ FUNC(GLOBAL(mulsi3))
#endif
#endif /* ! __SH5__ */
#ifdef L_sdivsi3_i4
@@ -875,6 +1003,7 @@ hiset: sts macl,r0 ! r0 = bb*dd
!! args in r4 and r5, result in fpul, clobber dr0, dr2
.global GLOBAL(sdivsi3_i4)
+ FUNC(GLOBAL(sdivsi3_i4))
GLOBAL(sdivsi3_i4):
lds r4,fpul
float fpul,dr0
@@ -884,6 +1013,7 @@ GLOBAL(sdivsi3_i4):
rts
ftrc dr0,fpul
+ ENDFUNC(GLOBAL(sdivsi3_i4))
#elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__)
!! args in r4 and r5, result in fpul, clobber r2, dr0, dr2
@@ -892,6 +1022,7 @@ GLOBAL(sdivsi3_i4):
.mode SHcompact
#endif
.global GLOBAL(sdivsi3_i4)
+ FUNC(GLOBAL(sdivsi3_i4))
GLOBAL(sdivsi3_i4):
sts.l fpscr,@-r15
mov #8,r2
@@ -906,6 +1037,7 @@ GLOBAL(sdivsi3_i4):
rts
lds.l @r15+,fpscr
+ ENDFUNC(GLOBAL(sdivsi3_i4))
#endif /* ! __SH5__ || __SH5__ == 32 */
#endif /* ! __SH4__ */
#endif
@@ -920,9 +1052,10 @@ GLOBAL(sdivsi3_i4):
!!
!!
-!! args in r4 and r5, result in r0 clobber r1,r2,r3
+!! args in r4 and r5, result in r0 clobber r1, r2, r3, and t bit
.global GLOBAL(sdivsi3)
+ FUNC(GLOBAL(sdivsi3))
#if __SHMEDIA__
#if __SH5__ == 32
.section .text..SHmedia32,"ax"
@@ -1166,6 +1299,7 @@ GLOBAL(sdivsi3):
div0: rts
mov #0,r0
+ ENDFUNC(GLOBAL(sdivsi3))
#endif /* ! __SHMEDIA__ */
#endif /* ! __SH4__ */
#endif
@@ -1174,9 +1308,11 @@ div0: rts
.title "SH DIVIDE"
!! 4 byte integer Divide code for the Hitachi SH
#ifdef __SH4__
-!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4
+!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4,
+!! and t bit
.global GLOBAL(udivsi3_i4)
+ FUNC(GLOBAL(udivsi3_i4))
GLOBAL(udivsi3_i4):
mov #1,r1
cmp/hi r1,r5
@@ -1217,11 +1353,13 @@ trivial:
L1:
.double 2147483648
+ ENDFUNC(GLOBAL(udivsi3_i4))
#elif defined (__SH5__) && ! defined (__SH4_NOFPU__)
#if ! __SH5__ || __SH5__ == 32
!! args in r4 and r5, result in fpul, clobber r20, r21, dr0, fr33
.mode SHmedia
.global GLOBAL(udivsi3_i4)
+ FUNC(GLOBAL(udivsi3_i4))
GLOBAL(udivsi3_i4):
addz.l r4,r63,r20
addz.l r5,r63,r21
@@ -1234,6 +1372,8 @@ GLOBAL(udivsi3_i4):
ftrc.dq dr0,dr32
fmov.s fr33,fr32
blink tr0,r63
+
+ ENDFUNC(GLOBAL(udivsi3_i4))
#endif /* ! __SH5__ || __SH5__ == 32 */
#elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__)
!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4
@@ -1287,6 +1427,7 @@ L1:
#endif
.double 2147483648
+ ENDFUNC(GLOBAL(udivsi3_i4))
#endif /* ! __SH4__ */
#endif
@@ -1297,6 +1438,7 @@ L1:
!! args in r4 and r5, result in r0, clobbers r4, pr, and t bit
.global GLOBAL(udivsi3)
+ FUNC(GLOBAL(udivsi3))
#if __SHMEDIA__
#if __SH5__ == 32
@@ -1485,6 +1627,7 @@ LOCAL(large_divisor):
rts
rotcl r0
+ ENDFUNC(GLOBAL(udivsi3))
#endif /* ! __SHMEDIA__ */
#endif /* __SH4__ */
#endif /* L_udivsi3 */
@@ -1790,6 +1933,7 @@ GLOBAL(moddi3):
.mode SHcompact
#endif
.global GLOBAL(set_fpscr)
+ FUNC(GLOBAL(set_fpscr))
GLOBAL(set_fpscr):
lds r4,fpscr
mov.l LOCAL(set_fpscr_L1),r1
@@ -1822,6 +1966,8 @@ GLOBAL(set_fpscr):
.align 2
LOCAL(set_fpscr_L1):
.long GLOBAL(fpscr_values)
+
+ ENDFUNC(GLOBAL(set_fpscr))
#ifdef __ELF__
.comm GLOBAL(fpscr_values),8,4
#else
@@ -1860,6 +2006,7 @@ GLOBAL(ic_invalidate):
blink tr0, r63
#elif defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__)
.global GLOBAL(ic_invalidate)
+ FUNC(GLOBAL(ic_invalidate))
GLOBAL(ic_invalidate):
ocbwb @r4
mova 0f,r0
@@ -1882,6 +2029,8 @@ GLOBAL(ic_invalidate):
nop
.endr
.endr
+
+ ENDFUNC(GLOBAL(ic_invalidate))
#endif /* SH4 */
#endif /* L_ic_invalidate */
@@ -1940,6 +2089,7 @@ LOCAL(ct_main_table):
will be expanded into r2/r3 upon return. */
.global GLOBAL(GCC_shcompact_call_trampoline)
+ FUNC(GLOBAL(GCC_shcompact_call_trampoline))
GLOBAL(GCC_shcompact_call_trampoline):
ptabs/l r0, tr0 /* Prepare to call the actual function. */
movi ((datalabel LOCAL(ct_main_table) - 31 * 2) >> 16) & 65535, r0
@@ -2290,6 +2440,8 @@ LOCAL(ct_ret_wide): /* Call the function, so that we can unpack its
shari r2, 32, r2
#endif
blink tr0, r63
+
+ ENDFUNC(GLOBAL(GCC_shcompact_call_trampoline))
#endif /* L_shcompact_call_trampoline */
#ifdef L_shcompact_return_trampoline
@@ -2302,6 +2454,7 @@ LOCAL(ct_ret_wide): /* Call the function, so that we can unpack its
.section .text..SHmedia32, "ax"
.align 2
.global GLOBAL(GCC_shcompact_return_trampoline)
+ FUNC(GLOBAL(GCC_shcompact_return_trampoline))
GLOBAL(GCC_shcompact_return_trampoline):
ptabs/l r18, tr0
#if __LITTLE_ENDIAN__
@@ -2313,6 +2466,8 @@ GLOBAL(GCC_shcompact_return_trampoline):
#endif
or r3, r2, r2
blink tr0, r63
+
+ ENDFUNC(GLOBAL(GCC_shcompact_return_trampoline))
#endif /* L_shcompact_return_trampoline */
#ifdef L_shcompact_incoming_args
@@ -2367,6 +2522,7 @@ LOCAL(ia_main_table):
actual bit pattern. */
.global GLOBAL(GCC_shcompact_incoming_args)
+ FUNC(GLOBAL(GCC_shcompact_incoming_args))
GLOBAL(GCC_shcompact_incoming_args):
ptabs/l r18, tr0 /* Prepare to return. */
shlri r17, 32, r0 /* Load the cookie. */
@@ -2519,6 +2675,7 @@ LOCAL(ia_r9_push): /* Push r9 onto the stack. */
LOCAL(ia_return): /* Return. */
blink tr0, r63
LOCAL(ia_end_of_push_seq): /* Label used to compute the first push instruction. */
+ ENDFUNC(GLOBAL(GCC_shcompact_incoming_args))
#endif /* L_shcompact_incoming_args */
#endif
#if __SH5__
@@ -2530,6 +2687,7 @@ LOCAL(ia_end_of_push_seq): /* Label used to compute the first push instruction.
#endif
.align 3 /* It is copied in units of 8 bytes in SHmedia mode. */
.global GLOBAL(GCC_nested_trampoline)
+ FUNC(GLOBAL(GCC_nested_trampoline))
GLOBAL(GCC_nested_trampoline):
.mode SHmedia
ptrel/u r63, tr0
@@ -2546,6 +2704,8 @@ GLOBAL(GCC_nested_trampoline):
ld.l r0, 28, r1
#endif
blink tr1, r63
+
+ ENDFUNC(GLOBAL(GCC_nested_trampoline))
#endif /* L_nested_trampoline */
#endif /* __SH5__ */
#if __SH5__ == 32
@@ -2555,6 +2715,7 @@ GLOBAL(GCC_nested_trampoline):
.align 2
#ifndef __SH4_NOFPU__
.global GLOBAL(GCC_push_shmedia_regs)
+ FUNC(GLOBAL(GCC_push_shmedia_regs))
GLOBAL(GCC_push_shmedia_regs):
addi.l r15, -14*8, r15
fst.d r15, 13*8, dr62
@@ -2573,6 +2734,7 @@ GLOBAL(GCC_push_shmedia_regs):
fst.d r15, 0*8, dr36
#endif
.global GLOBAL(GCC_push_shmedia_regs_nofpu)
+ FUNC(GLOBAL(GCC_push_shmedia_regs_nofpu))
GLOBAL(GCC_push_shmedia_regs_nofpu):
ptabs/l r18, tr0
addi.l r15, -27*8, r15
@@ -2608,8 +2770,13 @@ GLOBAL(GCC_push_shmedia_regs_nofpu):
st.q r15, 0*8, r28
blink tr0, r63
+#ifndef __SH4_NOFPU__
+ ENDFUNC(GLOBAL(GCC_push_shmedia_regs))
+#endif
+ ENDFUNC(GLOBAL(GCC_push_shmedia_regs_nofpu))
#ifndef __SH4_NOFPU__
.global GLOBAL(GCC_pop_shmedia_regs)
+ FUNC(GLOBAL(GCC_pop_shmedia_regs))
GLOBAL(GCC_pop_shmedia_regs):
pt .L0, tr1
movi 41*8, r0
@@ -2630,6 +2797,7 @@ GLOBAL(GCC_pop_shmedia_regs):
blink tr1, r63
#endif
.global GLOBAL(GCC_pop_shmedia_regs_nofpu)
+ FUNC(GLOBAL(GCC_pop_shmedia_regs_nofpu))
GLOBAL(GCC_pop_shmedia_regs_nofpu):
movi 27*8, r0
.L0:
@@ -2666,5 +2834,10 @@ GLOBAL(GCC_pop_shmedia_regs_nofpu):
ld.q r15, 0*8, r28
add.l r15, r0, r15
blink tr0, r63
+
+#ifndef __SH4_NOFPU__
+ ENDFUNC(GLOBAL(GCC_pop_shmedia_regs))
+#endif
+ ENDFUNC(GLOBAL(GCC_pop_shmedia_regs_nofpu))
#endif /* __SH5__ == 32 */
#endif /* L_push_pop_shmedia_regs */
diff --git a/gcc/config/sh/libgcc-glibc.ver b/gcc/config/sh/libgcc-glibc.ver
new file mode 100644
index 00000000000..734d3d6bfe1
--- /dev/null
+++ b/gcc/config/sh/libgcc-glibc.ver
@@ -0,0 +1,21 @@
+# In order to work around the very problems that force us to now generally
+# create a libgcc.so, glibc reexported a number of routines from libgcc.a.
+# By now choosing the same version tags for these specific routines, we
+# maintain enough binary compatibility to allow future versions of glibc
+# to defer implementation of these routines to libgcc.so via DT_AUXILIARY.
+
+# Note that we cannot use the default libgcc-glibc.ver file on sh,
+# because GLIBC_2.0 does not exist on this architecture, as the first
+# ever glibc release on the platform was GLIBC_2.2.
+
+%inherit GCC_3.0 GLIBC_2.2
+GLIBC_2.2 {
+ __register_frame
+ __register_frame_table
+ __deregister_frame
+ __register_frame_info
+ __deregister_frame_info
+ __frame_state_for
+ __register_frame_info_table
+}
+
diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h
index 1a3948386fc..c4f6171a5d0 100644
--- a/gcc/config/sh/linux.h
+++ b/gcc/config/sh/linux.h
@@ -23,6 +23,22 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_VERSION
#define TARGET_VERSION fputs (" (SH GNU/Linux with ELF)", stderr);
+/* We're not SYSVR4, not having /usr/ccs */
+#undef MD_EXEC_PREFIX
+#undef MD_STARTFILE_PREFIX
+
+/* This was defined in linux.h. Define it here also. */
+#define HANDLE_PRAGMA_PACK_PUSH_POP
+
+/* Enable DWARF 2 exceptions. */
+#undef DWARF2_UNWIND_INFO
+#define DWARF2_UNWIND_INFO 1
+
+#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
+ (flag_pic \
+ ? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4 \
+ : DW_EH_PE_absptr)
+
#undef SUBTARGET_CPP_SPEC
#define SUBTARGET_CPP_SPEC "\
%{posix:-D_POSIX_SOURCE} \
@@ -55,9 +71,15 @@ do { \
#undef LIB_SPEC
#define LIB_SPEC \
"%{shared: -lc} \
+ %{!static:-rpath-link %R/lib:%R/usr/lib} \
%{!shared: %{pthread:-lthread} \
%{profile:-lc_p} %{!profile: -lc}}"
+#if defined(HAVE_LD_EH_FRAME_HDR)
+#undef LINK_EH_SPEC
+#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+#endif
+
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
"%{!shared: \
@@ -65,3 +87,176 @@ do { \
%{!p:%{profile:gcrt1.o%s} \
%{!profile:crt1.o%s}}}} \
crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+
+/* Output assembler code to STREAM to call the profiler. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(STREAM,LABELNO) \
+ do { \
+ if (flag_pic) \
+ { \
+ fprintf (STREAM, "\tmov.l\t3f,r1\n"); \
+ fprintf (STREAM, "\tmova\t3f,r0\n"); \
+ fprintf (STREAM, "\tadd\tr1,r0\n"); \
+ fprintf (STREAM, "\tmov.l\t1f,r1\n"); \
+ fprintf (STREAM, "\tmov.l\t@(r0,r1),r1\n"); \
+ } \
+ else \
+ fprintf (STREAM, "\tmov.l\t1f,r1\n"); \
+ fprintf (STREAM, "\tsts.l\tpr,@-r15\n"); \
+ fprintf (STREAM, "\tmova\t2f,r0\n"); \
+ fprintf (STREAM, "\tjmp\t@r1\n"); \
+ fprintf (STREAM, "\tlds\tr0,pr\n"); \
+ fprintf (STREAM, "\t.align\t2\n"); \
+ if (flag_pic) \
+ { \
+ fprintf (STREAM, "1:\t.long\tmcount@GOT\n"); \
+ fprintf (STREAM, "3:\t.long\t_GLOBAL_OFFSET_TABLE_\n"); \
+ } \
+ else \
+ fprintf (STREAM, "1:\t.long\tmcount\n"); \
+ fprintf (STREAM, "2:\tlds.l\t@r15+,pr\n"); \
+ } while (0)
+
+/* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
+#ifdef IN_LIBGCC2
+#include <signal.h>
+#include <sys/ucontext.h>
+#include "insn-constants.h"
+
+# if defined (__SH5__)
+#define SH_DWARF_FRAME_GP0 0
+#define SH_DWARF_FRAME_FP0 (__SH5__ == 32 ? 245 : 77)
+#define SH_DWARF_FRAME_XD0 289
+#define SH_DWARF_FRAME_BT0 68
+#define SH_DWARF_FRAME_PR 241
+#define SH_DWARF_FRAME_PR_MEDIA 18
+#define SH_DWARF_FRAME_GBR 238
+#define SH_DWARF_FRAME_MACH 239
+#define SH_DWARF_FRAME_MACL 240
+#define SH_DWARF_FRAME_PC 64
+#define SH_DWARF_FRAME_SR 65
+#define SH_DWARF_FRAME_FPUL 244
+#define SH_DWARF_FRAME_FPSCR 243
+#else
+#define SH_DWARF_FRAME_GP0 0
+#define SH_DWARF_FRAME_FP0 25
+#define SH_DWARF_FRAME_XD0 87
+#define SH_DWARF_FRAME_PR 17
+#define SH_DWARF_FRAME_GBR 19
+#define SH_DWARF_FRAME_MACH 20
+#define SH_DWARF_FRAME_MACL 21
+#define SH_DWARF_FRAME_PC 16
+#define SH_DWARF_FRAME_SR 22
+#define SH_DWARF_FRAME_FPUL 23
+#define SH_DWARF_FRAME_FPSCR 24
+#endif /* defined (__SH5__) */
+
+#if defined (__SH5__) && __SH5__ != 32
+/* MD_FALLBACK_FRAME_STATE_FOR is not yet defiened for SHMEDIA. */
+#else /* defined (__SH5__) && __SH5__ != 32 */
+
+#if defined (__SH3E__) || defined (__SH4__) || defined (__SH5__)
+#define SH_FALLBACK_FRAME_FLOAT_STATE(SC, FS, CFA) \
+ do { \
+ int i_, r_; \
+ \
+ r_ = SH_DWARF_FRAME_FP0; \
+ for (i_ = 0; i_ < 16; i_++) \
+ { \
+ (FS)->regs.reg[r_+i_].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[r_+i_].loc.offset \
+ = (long)&((SC)->sc_fpregs[i_]) - (CFA); \
+ } \
+ \
+ r_ = SH_DWARF_FRAME_XD0 ; \
+ for (i_ = 0; i_ < 8; i_++) \
+ { \
+ (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[i_].loc.offset \
+ = (long)&((SC)->sc_xfpregs[2*i_]) - (CFA); \
+ } \
+ \
+ (FS)->regs.reg[SH_DWARF_FRAME_FPUL].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[SH_DWARF_FRAME_FPUL].loc.offset \
+ = (long)&((SC)->sc_fpul) - (CFA); \
+ (FS)->regs.reg[SH_DWARF_FRAME_FPSCR].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[SH_DWARF_FRAME_FPSCR].loc.offset \
+ = (long)&((SC)->sc_fpscr) - (CFA); \
+ } while (0)
+
+#else
+#define SH_FALLBACK_FRAME_FLOAT_STATE(SC, FS, CFA)
+#endif
+
+#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
+ do { \
+ unsigned char *pc_ = (CONTEXT)->ra; \
+ struct sigcontext *sc_; \
+ long new_cfa_; \
+ int i_; \
+ \
+ /* mov.w 1f,r3; trapa #0x10; 1: .short 0x77 (sigreturn) */ \
+ /* mov.w 1f,r3; trapa #0x10; 1: .short 0xad (rt_sigreturn) */ \
+ if ((*(unsigned short *) (pc_+0) == 0x9300) \
+ && (*(unsigned short *) (pc_+2) == 0xc310) \
+ && (*(unsigned short *) (pc_+4) == 0x0077)) \
+ sc_ = (CONTEXT)->cfa; \
+ else if ((*(unsigned short *) (pc_+0) == 0x9300) \
+ && (*(unsigned short *) (pc_+2) == 0xc310) \
+ && (*(unsigned short *) (pc_+4) == 0x00ad)) \
+ { \
+ struct rt_sigframe { \
+ struct siginfo info; \
+ struct ucontext uc; \
+ } *rt_ = (CONTEXT)->cfa; \
+ sc_ = (struct sigcontext *) &rt_->uc.uc_mcontext; \
+ } \
+ else \
+ break; \
+ \
+ new_cfa_ = sc_->sc_regs[15]; \
+ (FS)->cfa_how = CFA_REG_OFFSET; \
+ (FS)->cfa_reg = 15; \
+ (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \
+ \
+ for (i_ = 0; i_ < 15; i_++) \
+ { \
+ (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[i_].loc.offset \
+ = (long)&(sc_->sc_regs[i_]) - new_cfa_; \
+ } \
+ \
+ (FS)->regs.reg[SH_DWARF_FRAME_PR].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[SH_DWARF_FRAME_PR].loc.offset \
+ = (long)&(sc_->sc_pr) - new_cfa_; \
+ (FS)->regs.reg[SH_DWARF_FRAME_SR].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[SH_DWARF_FRAME_SR].loc.offset \
+ = (long)&(sc_->sc_sr) - new_cfa_; \
+ (FS)->regs.reg[SH_DWARF_FRAME_GBR].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[SH_DWARF_FRAME_GBR].loc.offset \
+ = (long)&(sc_->sc_gbr) - new_cfa_; \
+ (FS)->regs.reg[SH_DWARF_FRAME_MACH].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[SH_DWARF_FRAME_MACH].loc.offset \
+ = (long)&(sc_->sc_mach) - new_cfa_; \
+ (FS)->regs.reg[SH_DWARF_FRAME_MACL].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[SH_DWARF_FRAME_MACL].loc.offset \
+ = (long)&(sc_->sc_macl) - new_cfa_; \
+ \
+ SH_FALLBACK_FRAME_FLOAT_STATE(sc_, (FS), new_cfa_); \
+ \
+ /* The unwinder expects the PC to point to the following insn, \
+ whereas the kernel returns the address of the actual \
+ faulting insn. */ \
+ sc_->sc_pc += 2; \
+ (FS)->regs.reg[SH_DWARF_FRAME_PC].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[SH_DWARF_FRAME_PC].loc.offset \
+ = (long)&(sc_->sc_pc) - new_cfa_; \
+ (FS)->retaddr_column = SH_DWARF_FRAME_PC; \
+ goto SUCCESS; \
+ } while (0)
+
+#endif /* defined (__SH5__) && __SH5__ != 32 */
+#endif /* IN_LIBGCC2 */
diff --git a/gcc/config/sh/sh-protos.h b/gcc/config/sh/sh-protos.h
index 4135b334af1..fd98b421c0e 100644
--- a/gcc/config/sh/sh-protos.h
+++ b/gcc/config/sh/sh-protos.h
@@ -120,6 +120,7 @@ extern int sh_media_register_for_return PARAMS ((void));
extern void sh_expand_prologue PARAMS ((void));
extern void sh_expand_epilogue PARAMS ((void));
extern int sh_need_epilogue PARAMS ((void));
+extern void sh_set_return_address PARAMS ((rtx, rtx));
extern int initial_elimination_offset PARAMS ((int, int));
extern int fldi_ok PARAMS ((void));
extern int sh_pr_n_sets PARAMS ((void));
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 75c9d263bfa..261f3247af5 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -23,6 +23,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "insn-config.h"
#include "rtl.h"
#include "tree.h"
@@ -200,6 +202,7 @@ static void sh_insert_attributes PARAMS ((tree, tree *));
static int sh_adjust_cost PARAMS ((rtx, rtx, rtx, int));
static int sh_use_dfa_interface PARAMS ((void));
static int sh_issue_rate PARAMS ((void));
+static bool sh_function_ok_for_sibcall PARAMS ((tree, tree));
static bool sh_cannot_modify_jumps_p PARAMS ((void));
static bool sh_ms_bitfield_layout_p PARAMS ((tree));
@@ -260,6 +263,9 @@ static void flow_dependent_p_1 PARAMS ((rtx, rtx, void *));
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN sh_expand_builtin
+#undef TARGET_FUNCTION_OK_FOR_SIBCALL
+#define TARGET_FUNCTION_OK_FOR_SIBCALL sh_function_ok_for_sibcall
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Print the operand address in x to the stream. */
@@ -1013,12 +1019,12 @@ output_far_jump (insn, op)
if (far && flag_pic && TARGET_SH2)
{
braf_base_lab = gen_label_rtx ();
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (braf_base_lab));
}
if (far)
output_asm_insn (".align 2", 0);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L", CODE_LABEL_NUMBER (this.lab));
+ (*targetm.asm_out.internal_label) (asm_out_file, "L", CODE_LABEL_NUMBER (this.lab));
this.op = op;
if (far && flag_pic)
{
@@ -1077,7 +1083,7 @@ output_branch (logic, insn, operands)
output_asm_insn ("bra\t%l0", &op0);
fprintf (asm_out_file, "\tnop\n");
- ASM_OUTPUT_INTERNAL_LABEL(asm_out_file, "LF", label);
+ (*targetm.asm_out.internal_label)(asm_out_file, "LF", label);
return "";
}
@@ -4166,7 +4172,7 @@ final_prescan_insn (insn, opvec, noperands)
asm_fprintf (asm_out_file, "\t.uses %LL%d\n",
CODE_LABEL_NUMBER (XEXP (note, 0)));
else if (GET_CODE (pattern) == SET)
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (XEXP (note, 0)));
else
abort ();
@@ -4189,7 +4195,7 @@ output_jump_label_table ()
{
pool_node *p = &pool_vector[i];
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (p->label));
output_asm_insn (".long %O0", &p->value);
}
@@ -4444,7 +4450,12 @@ calc_live_regs (count_ptr, live_regs_mask)
&& flag_pic
&& current_function_args_info.call_cookie
&& reg == PIC_OFFSET_TABLE_REGNUM)
- || (regs_ever_live[reg] && ! call_used_regs[reg])))
+ || (regs_ever_live[reg] && ! call_used_regs[reg])
+ || (current_function_calls_eh_return
+ && (reg == EH_RETURN_DATA_REGNO (0)
+ || reg == EH_RETURN_DATA_REGNO (1)
+ || reg == EH_RETURN_DATA_REGNO (2)
+ || reg == EH_RETURN_DATA_REGNO (3)))))
{
live_regs_mask[reg / 32] |= 1 << (reg % 32);
count += GET_MODE_SIZE (REGISTER_NATURAL_MODE (reg));
@@ -4629,6 +4640,9 @@ sh_expand_prologue ()
higher addresses, that are known to be aligned. Then, we
proceed to saving 32-bit registers that don't need 8-byte
alignment. */
+ /* Note that if you change this code in a way that affects where
+ the return register is saved, you have to update not only
+ sh_expand_epilogue, but also sh_set_return_address. */
for (align = 1; align >= 0; align--)
for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--)
if (live_regs_mask[i/32] & (1 << (i % 32)))
@@ -5040,6 +5054,10 @@ sh_expand_epilogue ()
+ current_function_args_info.stack_regs * 8,
stack_pointer_rtx, 7, emit_insn);
+ if (current_function_calls_eh_return)
+ emit_insn (GEN_ADD3 (stack_pointer_rtx, stack_pointer_rtx,
+ EH_RETURN_STACKADJ_RTX));
+
/* Switch back to the normal stack if necessary. */
if (sp_switch)
emit_insn (gen_sp_switch_2 ());
@@ -5070,6 +5088,105 @@ sh_need_epilogue ()
return sh_need_epilogue_known > 0;
}
+/* Emit code to change the current function's return address to RA.
+ TEMP is available as a scratch register, if needed. */
+
+void
+sh_set_return_address (ra, tmp)
+ rtx ra, tmp;
+{
+ HOST_WIDE_INT live_regs_mask[(FIRST_PSEUDO_REGISTER + 31) / 32];
+ int d;
+ int d_rounding = 0;
+ int pr_reg = TARGET_SHMEDIA ? PR_MEDIA_REG : PR_REG;
+ int pr_offset;
+
+ calc_live_regs (&d, live_regs_mask);
+
+ /* If pr_reg isn't life, we can set it (or the register given in
+ sh_media_register_for_return) directly. */
+ if ((live_regs_mask[pr_reg / 32] & (1 << (pr_reg % 32))) == 0)
+ {
+ rtx rr;
+
+ if (TARGET_SHMEDIA)
+ {
+ int rr_regno = sh_media_register_for_return ();
+
+ if (rr_regno < 0)
+ rr_regno = pr_reg;
+
+ rr = gen_rtx_REG (DImode, rr_regno);
+ }
+ else
+ rr = gen_rtx_REG (SImode, pr_reg);
+
+ emit_insn (GEN_MOV (rr, ra));
+ /* Tell flow the register for return isn't dead. */
+ emit_insn (gen_rtx_USE (VOIDmode, rr));
+ return;
+ }
+
+ if (TARGET_SH5)
+ {
+ int i;
+ int offset;
+ int align;
+
+ if (d % (STACK_BOUNDARY / BITS_PER_UNIT))
+ d_rounding = ((STACK_BOUNDARY / BITS_PER_UNIT)
+ - d % (STACK_BOUNDARY / BITS_PER_UNIT));
+
+ offset = 0;
+
+ /* We loop twice: first, we save 8-byte aligned registers in the
+ higher addresses, that are known to be aligned. Then, we
+ proceed to saving 32-bit registers that don't need 8-byte
+ alignment. */
+ for (align = 0; align <= 1; align++)
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (live_regs_mask[i/32] & (1 << (i % 32)))
+ {
+ enum machine_mode mode = REGISTER_NATURAL_MODE (i);
+
+ if (mode == SFmode && (i % 2) == 0
+ && ! TARGET_FPU_SINGLE && FP_REGISTER_P (i)
+ && (live_regs_mask[(i ^ 1) / 32] & (1 << ((i ^ 1) % 32))))
+ {
+ mode = DFmode;
+ i++;
+ }
+
+ /* If we're doing the aligned pass and this is not aligned,
+ or we're doing the unaligned pass and this is aligned,
+ skip it. */
+ if ((GET_MODE_SIZE (mode) % (STACK_BOUNDARY / BITS_PER_UNIT)
+ == 0) != align)
+ continue;
+
+ if (i == pr_reg)
+ goto found;
+
+ offset += GET_MODE_SIZE (mode);
+ }
+
+ /* We can't find pr register. */
+ abort ();
+
+ found:
+ pr_offset = (rounded_frame_size (d) - d_rounding + offset
+ + SHMEDIA_REGS_STACK_ADJUST ());
+ }
+ else
+ pr_offset = rounded_frame_size (d) - d_rounding;
+
+ emit_insn (GEN_MOV (tmp, GEN_INT (pr_offset)));
+ emit_insn (GEN_ADD3 (tmp, tmp, frame_pointer_rtx));
+
+ tmp = gen_rtx_MEM (Pmode, tmp);
+ emit_insn (GEN_MOV (tmp, ra));
+}
+
/* Clear variables at function end. */
static void
@@ -7405,6 +7522,19 @@ sh_initialize_trampoline (tramp, fnaddr, cxt)
}
}
+/* FIXME: This is overly conservative. A SHcompact function that
+ receives arguments ``by reference'' will have them stored in its
+ own stack frame, so it must not pass pointers or references to
+ these arguments to other functions by means of sibling calls. */
+static bool
+sh_function_ok_for_sibcall (decl, exp)
+ tree decl;
+ tree exp ATTRIBUTE_UNUSED;
+{
+ return (decl
+ && (! TARGET_SHCOMPACT
+ || current_function_args_info.stack_regs == 0));
+}
/* Machine specific built-in functions. */
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 6e3b91a76e4..4d27e64bcb0 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -28,7 +28,7 @@ Boston, MA 02111-1307, USA. */
fputs (" (Hitachi SH)", stderr);
/* Unfortunately, insn-attrtab.c doesn't include insn-codes.h. We can't
- include it here, because hconfig.h is also included by gencodes.c . */
+ include it here, because bconfig.h is also included by gencodes.c . */
/* ??? No longer true. */
extern int code_for_indirect_jump_scratch;
@@ -1705,13 +1705,6 @@ struct sh_args {
(CUM).outgoing = 0; \
} while (0)
-/* FIXME: This is overly conservative. A SHcompact function that
- receives arguments ``by reference'' will have them stored in its
- own stack frame, so it must not pass pointers or references to
- these arguments to other functions by means of sibling calls. */
-#define FUNCTION_OK_FOR_SIBCALL(DECL) \
- (! TARGET_SHCOMPACT || current_function_args_info.stack_regs == 0)
-
/* Update the data in CUM to advance over an argument
of mode MODE and data type TYPE.
(TYPE is null for libcalls where that information may not be
@@ -2135,8 +2128,6 @@ while (0)
/* Addressing modes, and classification of registers for them. */
#define HAVE_POST_INCREMENT TARGET_SH1
-/*#define HAVE_PRE_INCREMENT 1*/
-/*#define HAVE_POST_DECREMENT 1*/
#define HAVE_PRE_DECREMENT TARGET_SH1
#define USE_LOAD_POST_INCREMENT(mode) ((mode == SImode || mode == DImode) \
@@ -2941,6 +2932,8 @@ while (0)
to match gdb. */
/* svr4.h undefines this macro, yet we really want to use the same numbers
for coff as for elf, so we go via another macro: SH_DBX_REGISTER_NUMBER. */
+/* expand_builtin_init_dwarf_reg_sizes uses this to test if a
+ register exists, so we should return -1 for invalid register numbers. */
#define DBX_REGISTER_NUMBER(REGNO) SH_DBX_REGISTER_NUMBER (REGNO)
#define SH_DBX_REGISTER_NUMBER(REGNO) \
@@ -2967,13 +2960,13 @@ while (0)
? (TARGET_SH5 ? 240 : 21) \
: (REGNO) == FPUL_REG \
? (TARGET_SH5 ? 244 : 23) \
- : (abort(), -1))
+ : -1)
/* This is how to output a reference to a user-level label named NAME. */
#define ASM_OUTPUT_LABELREF(FILE, NAME) \
do \
{ \
- char * lname; \
+ const char * lname; \
\
STRIP_DATALABEL_ENCODING (lname, (NAME)); \
if (lname[0] == '*') \
@@ -3009,11 +3002,6 @@ while (0)
/* #define ASM_OUTPUT_CASE_END(STREAM,NUM,TABLE) */
-/* Construct a private name. */
-#define ASM_FORMAT_PRIVATE_NAME(OUTVAR,NAME,NUMBER) \
- ((OUTVAR) = (char *) alloca (strlen (NAME) + 10), \
- sprintf ((OUTVAR), "%s.%d", (NAME), (NUMBER)))
-
/* Output a relative address table. */
#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM,BODY,VALUE,REL) \
@@ -3315,6 +3303,11 @@ extern int rtx_equal_function_value_matters;
#define DWARF_FRAME_RETURN_COLUMN \
(TARGET_SH5 ? DWARF_FRAME_REGNUM (PR_MEDIA_REG) : DWARF_FRAME_REGNUM (PR_REG))
+#define EH_RETURN_DATA_REGNO(N) \
+ ((N) < 4 ? (N) + (TARGET_SH5 ? 2 : 4) : INVALID_REGNUM)
+
+#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, STATIC_CHAIN_REGNUM)
+
#if (defined CRT_BEGIN || defined CRT_END) && ! __SHMEDIA__
/* SH constant pool breaks the devices in crtstuff.c to control section
in where code resides. We have to write it as asm code. */
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index e3f4ea01d35..029632f4c0a 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -135,6 +135,7 @@
(UNSPEC_FSINA 16)
(UNSPEC_NSB 17)
(UNSPEC_ALLOCO 18)
+ (UNSPEC_EH_RETURN 19)
;; These are used with unspec_volatile.
(UNSPECV_BLOCKAGE 0)
@@ -7145,6 +7146,48 @@
DONE;
}")
+(define_expand "eh_return"
+ [(use (match_operand 0 "register_operand" ""))
+ (use (match_operand 1 "register_operand" ""))]
+ ""
+{
+ rtx tmp, sa = operands[0], ra = operands[1];
+
+ if (TARGET_SHMEDIA64)
+ emit_insn (gen_eh_set_ra_di (ra));
+ else
+ emit_insn (gen_eh_set_ra_si (ra));
+
+ emit_move_insn (EH_RETURN_STACKADJ_RTX, sa);
+ DONE;
+})
+
+;; Clobber the return address on the stack. We can't expand this
+;; until we know where it will be put in the stack frame.
+
+(define_insn "eh_set_ra_si"
+ [(unspec [(match_operand:SI 0 "register_operand" "r")] UNSPEC_EH_RETURN)
+ (clobber (match_scratch:SI 1 "=&r"))]
+ "! TARGET_SHMEDIA64"
+ "#")
+
+(define_insn "eh_set_ra_di"
+ [(unspec [(match_operand:DI 0 "register_operand" "r")] UNSPEC_EH_RETURN)
+ (clobber (match_scratch:DI 1 "=&r"))]
+ "TARGET_SHMEDIA64"
+ "#")
+
+(define_split
+ [(unspec [(match_operand 0 "register_operand" "")] UNSPEC_EH_RETURN)
+ (clobber (match_scratch 1 ""))]
+ "reload_completed"
+ [(const_int 0)]
+ "
+{
+ sh_set_return_address (operands[0], operands[1]);
+ DONE;
+}")
+
(define_insn "blockage"
[(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)]
""
diff --git a/gcc/config/sh/t-linux b/gcc/config/sh/t-linux
index 2fc932cdc7f..195279a664a 100644
--- a/gcc/config/sh/t-linux
+++ b/gcc/config/sh/t-linux
@@ -8,4 +8,8 @@ MULTILIB_DIRNAMES=
MULTILIB_MATCHES =
MULTILIB_EXCEPTIONS=
-EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o
+EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
+
+# Override t-slibgcc-elf-ver to export some libgcc symbols with
+# the symbol versions that glibc used.
+SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver $(srcdir)/config/sh/libgcc-glibc.ver
diff --git a/gcc/config/sparc/freebsd.h b/gcc/config/sparc/freebsd.h
index 02cc7a1dfae..bd7fcd24445 100644
--- a/gcc/config/sparc/freebsd.h
+++ b/gcc/config/sparc/freebsd.h
@@ -130,14 +130,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define LOCAL_LABEL_PREFIX "."
/* XXX2 */
-/* This is how to output a definition of an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, ".L%s%d:\n", PREFIX, NUM)
-
-/* XXX2 */
/* This is how to output a reference to an internal numbered label where
PREFIX is the class of label and NUM is the number within the class. */
diff --git a/gcc/config/sparc/gmon-sol2.c b/gcc/config/sparc/gmon-sol2.c
index c5776661eea..c42badcf761 100644
--- a/gcc/config/sparc/gmon-sol2.c
+++ b/gcc/config/sparc/gmon-sol2.c
@@ -32,8 +32,10 @@
* for Cygnus Support, July 1992.
*/
-#include "config.h"
-#include "system.h"
+#include "tconfig.h"
+#include "tsystem.h"
+#include "coretypes.h"
+#include "tm.h"
#if 0
#include "sparc/gmon.h"
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index ea16b7eed5d..2879c642a71 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -206,13 +206,6 @@ do { \
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
-/* This is how to output a definition of an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, ".L%s%d:\n", PREFIX, NUM)
-
/* This is how to output a reference to an internal numbered label where
PREFIX is the class of label and NUM is the number within the class. */
diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
index 8fd3a1ff0df..40fd23257f7 100644
--- a/gcc/config/sparc/linux64.h
+++ b/gcc/config/sparc/linux64.h
@@ -276,13 +276,6 @@ do { \
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
-/* This is how to output a definition of an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, ".L%s%d:\n", PREFIX, NUM)
-
/* This is how to output a reference to an internal numbered label where
PREFIX is the class of label and NUM is the number within the class. */
diff --git a/gcc/config/sparc/netbsd-elf.h b/gcc/config/sparc/netbsd-elf.h
index 10788f2ae3b..7e0d70d9e79 100644
--- a/gcc/config/sparc/netbsd-elf.h
+++ b/gcc/config/sparc/netbsd-elf.h
@@ -69,13 +69,6 @@ Boston, MA 02111-1307, USA. */
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
-/* This is how to output a definition of an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, ".L%s%d:\n", PREFIX, NUM)
-
/* This is how to output a reference to an internal numbered label where
PREFIX is the class of label and NUM is the number within the class. */
diff --git a/gcc/config/sparc/pbd.h b/gcc/config/sparc/pbd.h
index e7c01c0b48a..dd47b368828 100644
--- a/gcc/config/sparc/pbd.h
+++ b/gcc/config/sparc/pbd.h
@@ -116,18 +116,9 @@ Boston, MA 02111-1307, USA. */
This is suitable for output with `assemble_name'. */
#undef ASM_GENERATE_INTERNAL_LABEL
-
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
sprintf (LABEL, "*.%s%ld", PREFIX, (long)(NUM))
-
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
-
/* This is how to output an element of a case-vector that is relative. */
#undef ASM_OUTPUT_ADDR_DIFF_ELT
diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h
index 3026e405f61..ba0243ceee2 100644
--- a/gcc/config/sparc/sol2.h
+++ b/gcc/config/sparc/sol2.h
@@ -68,13 +68,6 @@ Boston, MA 02111-1307, USA. */
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
-/* This is how to output a definition of an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, ".L%s%d:\n", PREFIX, NUM)
-
/* This is how to output a reference to an internal numbered label where
PREFIX is the class of label and NUM is the number within the class. */
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 9f608c352eb..aed7e4b79d5 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "regs.h"
@@ -176,6 +178,7 @@ static void emit_soft_tfmode_cvt PARAMS ((enum rtx_code, rtx *));
static void emit_hard_tfmode_operation PARAMS ((enum rtx_code, rtx *));
static void sparc_encode_section_info PARAMS ((tree, int));
+static bool sparc_function_ok_for_sibcall PARAMS ((tree, tree));
static void sparc_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
@@ -241,6 +244,9 @@ enum processor_type sparc_cpu;
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO sparc_encode_section_info
+#undef TARGET_FUNCTION_OK_FOR_SIBCALL
+#define TARGET_FUNCTION_OK_FOR_SIBCALL sparc_function_ok_for_sibcall
+
#undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK sparc_output_mi_thunk
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
@@ -3294,7 +3300,7 @@ load_pic_register ()
align = floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT);
if (align > 0)
ASM_OUTPUT_ALIGN (asm_out_file, align);
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LGETPC", 0);
+ (*targetm.asm_out.internal_label) (asm_out_file, "LGETPC", 0);
fputs ("\tretl\n\tadd\t%o7, %l7, %l7\n", asm_out_file);
}
@@ -7819,7 +7825,7 @@ sparc_output_addr_vec (vec)
ASM_OUTPUT_CASE_LABEL (asm_out_file, "L", CODE_LABEL_NUMBER (lab),
NEXT_INSN (lab));
#else
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L", CODE_LABEL_NUMBER (lab));
+ (*targetm.asm_out.internal_label) (asm_out_file, "L", CODE_LABEL_NUMBER (lab));
#endif
for (idx = 0; idx < vlen; idx++)
@@ -7849,7 +7855,7 @@ sparc_output_addr_diff_vec (vec)
ASM_OUTPUT_CASE_LABEL (asm_out_file, "L", CODE_LABEL_NUMBER (lab),
NEXT_INSN (lab));
#else
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L", CODE_LABEL_NUMBER (lab));
+ (*targetm.asm_out.internal_label) (asm_out_file, "L", CODE_LABEL_NUMBER (lab));
#endif
for (idx = 0; idx < vlen; idx++)
@@ -8028,6 +8034,32 @@ sparc_elf_asm_named_section (name, flags)
}
#endif /* OBJECT_FORMAT_ELF */
+/* We do not allow sibling calls if -mflat, nor
+ we do not allow indirect calls to be optimized into sibling calls.
+
+ Also, on sparc 32-bit we cannot emit a sibling call when the
+ current function returns a structure. This is because the "unimp
+ after call" convention would cause the callee to return to the
+ wrong place. The generic code already disallows cases where the
+ function being called returns a structure.
+
+ It may seem strange how this last case could occur. Usually there
+ is code after the call which jumps to epilogue code which dumps the
+ return value into the struct return area. That ought to invalidate
+ the sibling call right? Well, in the c++ case we can end up passing
+ the pointer to the struct return area to a constructor (which returns
+ void) and then nothing else happens. Such a sibling call would look
+ valid without the added check here. */
+static bool
+sparc_function_ok_for_sibcall (decl, exp)
+ tree decl;
+ tree exp ATTRIBUTE_UNUSED;
+{
+ return (decl
+ && ! TARGET_FLAT
+ && (TARGET_ARCH64 || ! current_function_returns_struct));
+}
+
/* ??? Similar to the standard section selection, but force reloc-y-ness
if SUNOS4_SHARED_LIBRARIES. Unclear why this helps (as opposed to
pretending PIC always on), but that's what the old code did. */
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 4dcff9105f0..ab000da6a6e 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -323,9 +323,11 @@ extern enum cmodel sparc_cmodel;
/* Special flags to the Sun-4 assembler when using pipe for input. */
#define ASM_SPEC "\
-%| %{R} %{!pg:%{!p:%{fpic:-k} %{fPIC:-k}}} %{keep-local-as-symbols:-L} \
+%{R} %{!pg:%{!p:%{fpic:-k} %{fPIC:-k}}} %{keep-local-as-symbols:-L} \
%(asm_cpu) %(asm_relax)"
+#define AS_NEEDS_DASH_FOR_PIPED_INPUT
+
/* This macro defines names of additional specifications to put in the specs
that can be used in various specifications like CC1_SPEC. Its definition
is an initializer with a subgrouping for each command option.
@@ -1932,27 +1934,6 @@ do { \
#define STRICT_ARGUMENT_NAMING TARGET_V9
-/* We do not allow sibling calls if -mflat, nor
- we do not allow indirect calls to be optimized into sibling calls.
-
- Also, on sparc 32-bit we cannot emit a sibling call when the
- current function returns a structure. This is because the "unimp
- after call" convention would cause the callee to return to the
- wrong place. The generic code already disallows cases where the
- function being called returns a structure.
-
- It may seem strange how this last case could occur. Usually there
- is code after the call which jumps to epilogue code which dumps the
- return value into the struct return area. That ought to invalidate
- the sibling call right? Well, in the c++ case we can end up passing
- the pointer to the struct return area to a constructor (which returns
- void) and then nothing else happens. Such a sibling call would look
- valid without the added check here. */
-#define FUNCTION_OK_FOR_SIBCALL(DECL) \
- (DECL \
- && ! TARGET_FLAT \
- && (TARGET_ARCH64 || ! current_function_returns_struct))
-
/* Generate RTL to flush the register windows so as to make arbitrary frames
available. */
#define SETUP_FRAME_ADDRESSES() \
@@ -2047,12 +2028,6 @@ do { \
/* Addressing modes, and classification of registers for them. */
-/* #define HAVE_POST_INCREMENT 0 */
-/* #define HAVE_POST_DECREMENT 0 */
-
-/* #define HAVE_PRE_DECREMENT 0 */
-/* #define HAVE_PRE_INCREMENT 0 */
-
/* Macros to check register numbers against specific register classes. */
/* These assume that REGNO is a hard or pseudo reg number.
@@ -2736,12 +2711,6 @@ case LABEL_REF: case SYMBOL_REF: case CONST_DOUBLE:
#define USER_LABEL_PREFIX "_"
-/* This is how to output a definition of an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, "%s%d:\n", PREFIX, NUM)
-
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
@@ -2852,14 +2821,6 @@ do { \
ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \
} while (0)
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
#define IDENT_ASM_OP "\t.ident\t"
/* Output #ident as a .ident. */
diff --git a/gcc/config/sparc/sysv4.h b/gcc/config/sparc/sysv4.h
index f304d6b5497..0543b46d531 100644
--- a/gcc/config/sparc/sysv4.h
+++ b/gcc/config/sparc/sysv4.h
@@ -93,7 +93,7 @@ Boston, MA 02111-1307, USA. */
#undef ASM_OUTPUT_CASE_LABEL
#define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \
do { ASM_OUTPUT_ALIGN ((FILE), Pmode == SImode ? 2 : 3); \
- ASM_OUTPUT_INTERNAL_LABEL ((FILE), PREFIX, NUM); \
+ (*targetm.asm_out.internal_label) ((FILE), PREFIX, NUM); \
} while (0)
/* This is how to equate one symbol to another symbol. The syntax used is
diff --git a/gcc/config/sparc/t-sol2 b/gcc/config/sparc/t-sol2
index 4a5a13b8618..f32765ff7f7 100644
--- a/gcc/config/sparc/t-sol2
+++ b/gcc/config/sparc/t-sol2
@@ -1,5 +1,6 @@
# gmon build rule:
-$(T)gmon.o: $(srcdir)/config/sparc/gmon-sol2.c $(GCC_PASSES) $(CONFIG_H) stmp-int-hdrs
+$(T)gmon.o: $(srcdir)/config/sparc/gmon-sol2.c $(GCC_PASSES) \
+ $(TCONFIG_H) tsystem.h coretypes.h $(TM_H) stmp-int-hdrs
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) \
-c $(srcdir)/config/sparc/gmon-sol2.c -o $(T)gmon.o
diff --git a/gcc/config/sparc/t-vxsparc b/gcc/config/sparc/t-vxsparc
deleted file mode 100644
index 5a47341ac40..00000000000
--- a/gcc/config/sparc/t-vxsparc
+++ /dev/null
@@ -1,10 +0,0 @@
-# We don't want to put exit in libgcc.a for VxWorks, because VxWorks
-# does not have _exit.
-TARGET_LIBGCC2_CFLAGS = -Dexit=unused_exit
-
-MULTILIB_OPTIONS=msoft-float mv8
-MULTILIB_DIRNAMES=soft v8
-MULTILIB_MATCHES=msoft-float=mno-fpu
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/sparc/t-vxsparc64 b/gcc/config/sparc/t-vxsparc64
deleted file mode 100644
index ee779eec91b..00000000000
--- a/gcc/config/sparc/t-vxsparc64
+++ /dev/null
@@ -1,23 +0,0 @@
-# We don't want to put exit in libgcc.a for VxWorks, because VxWorks
-# does not have _exit.
-TARGET_LIBGCC2_CFLAGS = -Dexit=unused_exit
-
-LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c
-
-dp-bit.c: $(srcdir)/config/fp-bit.c
- echo '#define US_SOFTWARE_GOFAST' > dp-bit.c
- cat $(srcdir)/config/fp-bit.c >> dp-bit.c
-
-fp-bit.c: $(srcdir)/config/fp-bit.c
- echo '#define FLOAT' > fp-bit.c
- echo '#define US_SOFTWARE_GOFAST' >> fp-bit.c
- cat $(srcdir)/config/fp-bit.c >> fp-bit.c
-
-MULTILIB_OPTIONS=O0
-MULTILIB_DIRNAMES=O0
-MULTILIB_MATCHES=
-MULTILIB_EXCEPTIONS=
-MULTILIB_EXTRA_OPTS=m64 mcpu=ultrasparc
-
-LIBGCC = stmp-multilib
-INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/sparc/vxsim.h b/gcc/config/sparc/vxsim.h
deleted file mode 100644
index c9c35699118..00000000000
--- a/gcc/config/sparc/vxsim.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/* Definitions of target machine for GNU compiler, for SPARC VxSim
- Copyright 1996 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. */
-
-#undef TARGET_VERSION
-#define TARGET_VERSION fprintf (stderr, " (sparc VxSim)");
-
-/* Supposedly the same as vanilla sparc svr4, except for the stuff below: */
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES \
- "-DCPU=SIMSPARCSOLARIS -D__vxworks -D__vxworks__ -Dsparc -D__svr4__ -D__SVR4 \
- -Asystem=embedded -Asystem=svr4 -Acpu=sparc -Amachine=sparc\
- -D__GCC_NEW_VARARGS__"
-
-#undef CPP_SPEC
-#define CPP_SPEC ""
-
-#undef CC1_SPEC
-#define CC1_SPEC "-fno-builtin %{sun4:} %{target:}"
-
-/* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
- It's safe to pass -s always, even if -g is not used. */
-#undef ASM_SPEC
-#define ASM_SPEC \
- "%{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s \
- %{fpic:-K PIC} %{fPIC:-K PIC}"
-
-/* However it appears that Solaris 2.0 uses the same reg numbering as
- the old BSD-style system did. */
-
-#undef DBX_REGISTER_NUMBER
-/* Same as sparc.h */
-#define DBX_REGISTER_NUMBER(REGNO) (REGNO)
-
-/* We use stabs-in-elf for debugging, because that is what the native
- toolchain uses. */
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-
-/* The Solaris 2 assembler uses .skip, not .zero, so put this back. */
-#undef ASM_OUTPUT_SKIP
-#define ASM_OUTPUT_SKIP(FILE,SIZE) \
- fprintf (FILE, "\t.skip %u\n", (SIZE))
-
-#undef ASM_OUTPUT_ALIGNED_LOCAL
-#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
-do { \
- fputs ("\t.local\t", (FILE)); \
- assemble_name ((FILE), (NAME)); \
- putc ('\n', (FILE)); \
- ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
-} while (0)
-
-#undef COMMON_ASM_OP
-#define COMMON_ASM_OP "\t.common\t"
-
-#undef LOCAL_LABEL_PREFIX
-#define LOCAL_LABEL_PREFIX "."
-
-/* This is how to output a definition of an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, ".L%s%d:\n", PREFIX, NUM)
-
-/* This is how to output a reference to an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#undef ASM_OUTPUT_INTERNAL_LABELREF
-#define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM) \
- fprintf (FILE, ".L%s%d", PREFIX, NUM)
-
-/* This is how to store into the string LABEL
- the symbol_ref name of an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class.
- This is suitable for output with `assemble_name'. */
-
-#undef ASM_GENERATE_INTERNAL_LABEL
-#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
- sprintf (LABEL, "*.L%s%ld", PREFIX, (long)(NUM))
-
-
-
-#undef LIB_SPEC
-#define LIB_SPEC ""
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC ""
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC ""
-
-#undef LINK_SPEC
-#define LINK_SPEC "-r"
-
-/* This defines which switch letters take arguments.
- It is as in svr4.h but with -R added. */
-
-#undef SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR) \
- ( (CHAR) == 'D' \
- || (CHAR) == 'U' \
- || (CHAR) == 'o' \
- || (CHAR) == 'e' \
- || (CHAR) == 'u' \
- || (CHAR) == 'I' \
- || (CHAR) == 'm' \
- || (CHAR) == 'L' \
- || (CHAR) == 'R' \
- || (CHAR) == 'A' \
- || (CHAR) == 'h' \
- || (CHAR) == 'z')
-
-/* ??? 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. */
-/* Define for support of TFmode long double.
- SPARC ABI says that long double is 4 words. */
-#define LONG_DOUBLE_TYPE_SIZE 64
diff --git a/gcc/config/sparc/vxsparc.h b/gcc/config/sparc/vxsparc.h
deleted file mode 100644
index da3e59105d8..00000000000
--- a/gcc/config/sparc/vxsparc.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Definitions of target machine for GNU compiler. Vxworks SPARC version.
- Copyright (C) 1994, 1996 Free Software Foundation, Inc.
- Contributed by David Henkel-Wallace (gumby@cygnus.com)
-
-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. */
-
-
-/* Specify what to link with. */
-/* VxWorks does all the library stuff itself. */
-
-#undef LIB_SPEC
-#define LIB_SPEC ""
-
-/* Provide required defaults for linker -e. */
-#undef LINK_SPEC
-#define LINK_SPEC "%{!nostdlib:%{!r*:%{!e*:-e start}}}"
-
-/* VxWorks provides the functionality of crt0.o and friends itself. */
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC ""
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dsparc -Acpu=sparc -Amachine=sparc"
-
-/* Note that we define CPU here even if the user has specified -ansi.
- This violates user namespace, but the VxWorks headers, and potentially
- user code, all explicitly rely upon the definition of CPU in order to get
- the proper processor information. */
-#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) -DCPU=SPARC"
-
-#undef PTRDIFF_TYPE
-#undef SIZE_TYPE
-#undef WCHAR_TYPE
-#undef WCHAR_TYPE_SIZE
-
-#define PTRDIFF_TYPE "long int"
-#define SIZE_TYPE "unsigned int"
-#define WCHAR_TYPE "char"
-#define WCHAR_TYPE_SIZE 8
-
-/* US Software GOFAST library support. */
-#undef INIT_SUBTARGET_OPTABS
-#define INIT_SUBTARGET_OPTABS INIT_GOFAST_OPTABS
diff --git a/gcc/config/sparc/vxsparc64.h b/gcc/config/sparc/vxsparc64.h
deleted file mode 100644
index 1da8b7f2566..00000000000
--- a/gcc/config/sparc/vxsparc64.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Definitions of target machine for GNU compiler.
- 64-bit VxWorks SPARC version.
- Copyright (C) 2001 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. */
-
-
-/* Specify what to link with. */
-/* VxWorks does all the library stuff itself. */
-#undef LIB_SPEC
-#define LIB_SPEC "-r"
-
-/* VxWorks provides the functionality of crt0.o and friends itself. */
-#undef STARTFILE_SPEC
-#undef ENDFILE_SPEC
-#define STARTFILE_SPEC ""
-#define ENDFILE_SPEC ""
-
-#undef LINK_SPEC
-#define LINK_SPEC ""
-
-/* We need to prohibit dots in constructor labels so that we can build a
- table of { string, address } entries for each non-static name in a
- program. The address, being of the form &name, it cannot contain a dot or
- C will try to parse it as a &struct.field phrase. */
-#undef NO_DOLLAR_IN_LABEL
-#undef DOLLARS_IN_IDENTIFIERS
-#define DOLLARS_IN_IDENTIFIERS 1
-#define NO_DOT_IN_LABEL
-
-/* Enable #pragma pack(n) */
-#define HANDLE_SYSV_PRAGMA 1
-
-/* We use stabs for debugging */
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-
-/* Longs are still only 32bits for vxWorks, even for UltraSPARC */
-#undef LONG_TYPE_SIZE
-#define LONG_TYPE_SIZE 32
-
-#undef CPP_ARCH32_SPEC
-#define CPP_ARCH32_SPEC "-Acpu(sparc) -Amachine(sparc)"
-#undef CPP_ARCH64_SPEC
-#define CPP_ARCH64_SPEC \
-"-Dsparc64 -D__arch64__ -Acpu(sparc64) -Amachine(sparc64)"
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D__vxworks -D__sparc__ -Dsparc -D__GCC_NEW_VARARGS__"
-
-/* Note that we define CPU here even if the user has specified -ansi.
- This violates user namespace, but the VxWorks headers, and potentially
- user code, all explicitly rely upon the definition of CPU in order to get
- the proper processor information. */
-#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %(cpp_arch) -DCPU=ULTRASPARC -D__CPU__=CPU"
-
-#undef TARGET_DEFAULT
-#define TARGET_DEFAULT (MASK_APP_REGS | MASK_FPU \
- | MASK_LONG_DOUBLE_128 | MASK_64BIT)
-
-#undef SPARC_DEFAULT_CMODEL
-#define SPARC_DEFAULT_CMODEL CM_MEDLOW
-
-#undef PTRDIFF_TYPE
-#undef SIZE_TYPE
-#undef WCHAR_TYPE
-#undef WCHAR_TYPE_SIZE
-
-#define PTRDIFF_TYPE "long int"
-#define SIZE_TYPE "unsigned int"
-#define WCHAR_TYPE "char"
-#define WCHAR_TYPE_SIZE 8
-
-/* US Software GOFAST library support. */
-#undef INIT_SUBTARGET_OPTABS
-#define INIT_SUBTARGET_OPTABS INIT_GOFAST_OPTABS
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 417a8dc03ab..4d98ea7bf85 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -22,6 +22,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h
index 87163dd415c..30f34a4748c 100644
--- a/gcc/config/stormy16/stormy16.h
+++ b/gcc/config/stormy16/stormy16.h
@@ -1986,8 +1986,6 @@ enum reg_class
#define HAVE_POST_INCREMENT 1
/* Similar for other kinds of addressing. */
-/* #define HAVE_PRE_INCREMENT 1 */
-/* #define HAVE_POST_DECREMENT 1 */
#define HAVE_PRE_DECREMENT 1
/* A C expression that is 1 if the RTX X is a constant which is a valid
@@ -2608,7 +2606,7 @@ do { \
outputting the label definition at the proper place. Here is how to do
this:
- ASM_OUTPUT_INTERNAL_LABEL (FILE, "LC", LABELNO);
+ (*targetm.asm_out.internal_label) (FILE, "LC", LABELNO);
When you output a pool entry specially, you should end with a `goto' to the
label JUMPTO. This will prevent the same pool entry from being output a
@@ -2881,31 +2879,11 @@ do { \
is in most Berkeley Unix systems. This macro is used in `assemble_name'. */
/* #define ASM_OUTPUT_LABELREF(STREAM, NAME) */
-/* A C statement to output to the stdio stream STREAM a label whose name is
- made from the string PREFIX and the number NUM.
-
- It is absolutely essential that these labels be distinct from the labels
- used for user-level functions and variables. Otherwise, certain programs
- will have name conflicts with internal labels.
-
- It is desirable to exclude internal labels from the symbol table of the
- object file. Most assemblers have a naming convention for labels that
- should be excluded; on many systems, the letter `L' at the beginning of a
- label has this effect. You should find out what convention your system
- uses, and follow it.
-
- The usual definition of this macro is as follows:
-
- fprintf (STREAM, "L%s%d:\n", PREFIX, NUM)
-
- Defined in svr4.h. */
-/* #define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM) */
-
/* A C statement to store into the string STRING a label whose name is made
from the string PREFIX and the number NUM.
This string, when output subsequently by `assemble_name', should produce the
- output that `ASM_OUTPUT_INTERNAL_LABEL' would produce with the same PREFIX
+ output that `(*targetm.asm_out.internal_label)' would produce with the same PREFIX
and NUM.
If the string begins with `*', then `assemble_name' will output the rest of
@@ -2918,27 +2896,6 @@ do { \
Defined in svr4.h. */
/* #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) */
-/* A C expression to assign to OUTVAR (which is a variable of type `char *') a
- newly allocated string made from the string NAME and the number NUMBER, with
- some suitable punctuation added. Use `alloca' to get space for the string.
-
- The string will be used as an argument to `ASM_OUTPUT_LABELREF' to produce
- an assembler label for an internal static variable whose name is NAME.
- Therefore, the string must be such as to result in valid assembler code.
- The argument NUMBER is different each time this macro is executed; it
- prevents conflicts between similarly-named internal static variables in
- different scopes.
-
- Ideally this string should not be a valid C identifier, to prevent any
- conflict with the user's own symbols. Most assemblers allow periods or
- percent signs in assembler symbols; putting at least one of these between
- the name and the number will suffice. */
-#define ASM_FORMAT_PRIVATE_NAME(OUTVAR, NAME, NUMBER) \
-do { \
- (OUTVAR) = (char *) alloca (strlen ((NAME)) + 12); \
- sprintf ((OUTVAR), "%s.%ld", (NAME), (long)(NUMBER)); \
-} while (0)
-
/* A C statement to output to the stdio stream STREAM assembler code which
defines (equates) the symbol NAME to have the value VALUE.
diff --git a/gcc/config/svr3.h b/gcc/config/svr3.h
index e559c5c59d3..8e1e9063e95 100644
--- a/gcc/config/svr3.h
+++ b/gcc/config/svr3.h
@@ -158,16 +158,6 @@ Boston, MA 02111-1307, USA.
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX "_"
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class.
-
- For most svr3 systems, the convention is that any symbol which begins
- with a period is not put into the linker symbol table by the assembler. */
-
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- asm_fprintf (FILE, "%0L%s%d:\n", PREFIX, NUM)
-
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
diff --git a/gcc/config/svr4.h b/gcc/config/svr4.h
index bc6a3b8ed5d..029ad2ccace 100644
--- a/gcc/config/svr4.h
+++ b/gcc/config/svr4.h
@@ -79,22 +79,16 @@ Boston, MA 02111-1307, USA.
Note that gcc doesn't allow a space to follow -Y in a -Ym,* or -Yd,*
option.
+
+ The svr4 assembler wants '-' on the command line if it's expected to
+ read its stdin.
*/
#undef ASM_SPEC
#define ASM_SPEC \
"%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"
-/* svr4 assemblers need the `-' (indicating input from stdin) to come after
- the -o option (and its argument) for some reason. If we try to put it
- before the -o option, the assembler will try to read the file named as
- the output file in the -o option as an input file (after it has already
- written some stuff to it) and the binary stuff contained therein will
- cause totally confuse the assembler, resulting in many spurious error
- messages. */
-
-#undef ASM_FINAL_SPEC
-#define ASM_FINAL_SPEC "%|"
+#define AS_NEEDS_DASH_FOR_PIPED_INPUT
/* Under svr4, the normal location of the `ld' and `as' programs is the
/usr/ccs/bin directory. */
diff --git a/gcc/config/t-darwin b/gcc/config/t-darwin
index aca59ba4f30..e8682e17db8 100644
--- a/gcc/config/t-darwin
+++ b/gcc/config/t-darwin
@@ -1,12 +1,12 @@
-darwin.o: $(srcdir)/config/darwin.c $(CONFIG_H) $(SYSTEM_H) $(RTL_BASE_H) \
- $(REGS_H) hard-reg-set.h insn-config.h conditions.h output.h \
- insn-attr.h flags.h $(TREE_H) $(EXPR_H) reload.h \
- function.h $(GGC_H) $(TM_P_H) gt-darwin.h
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+darwin.o: $(srcdir)/config/darwin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(REAL_H) insn-config.h \
+ conditions.h insn-flags.h output.h insn-attr.h flags.h $(TREE_H) expr.h \
+ reload.h function.h $(GGC_H) langhooks.h $(TM_P_H) gt-darwin.h
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/darwin.c
-darwin-c.o: $(srcdir)/config/darwin-c.c $(CONFIG_H) $(SYSTEM_H) \
- $(TREE_H) $(C_TREE_H) c-pragma.h toplev.h cpplib.h $(TM_P_H)
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+darwin-c.o: $(srcdir)/config/darwin-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(CPPLIB_H) tree.h c-pragma.h $(C_TREE_H) toplev.h $(TM_P_H)
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/darwin-c.c
gt-darwin.h : s-gtype ; @true
diff --git a/gcc/config/t-libunwind b/gcc/config/t-libunwind
new file mode 100644
index 00000000000..be50bc481c5
--- /dev/null
+++ b/gcc/config/t-libunwind
@@ -0,0 +1 @@
+LIB2ADDEH = $(srcdir)/unwind-libunwind.c $(srcdir)/unwind-sjlj.c
diff --git a/gcc/config/t-vxworks b/gcc/config/t-vxworks
new file mode 100644
index 00000000000..550a161152a
--- /dev/null
+++ b/gcc/config/t-vxworks
@@ -0,0 +1,25 @@
+# Don't run fixproto.
+STMP_FIXPROTO =
+
+# Since we have a functional assert.h, use it.
+INSTALL_ASSERT_H =
+
+# Build libgcc using the multilib mechanism
+
+LIBGCC = stmp-multilib
+INSTALL_LIBGCC = install-multilib
+
+# No special flags needed for libgcc.a
+TARGET_LIBGCC2_CFLAGS =
+
+# Don't build libgcc.a with debug info
+LIBGCC2_DEBUG_CFLAGS =
+
+# Extra libgcc2 module used by gthr-vxworks.h functions
+LIB2FUNCS_EXTRA = $(srcdir)/config/vxlib.c
+
+# This ensures that the correct target headers are used; some
+# VxWorks system headers have names that collide with GCC's
+# internal (host) headers, e.g. regs.h.
+# FIXME: May not be necessary anymore.
+LIBGCC2_INCLUDES="-I$(SYSTEM_HEADER_DIR)"
diff --git a/gcc/config/v850/t-v850 b/gcc/config/v850/t-v850
index bd07abead75..75c3b4695bd 100644
--- a/gcc/config/v850/t-v850
+++ b/gcc/config/v850/t-v850
@@ -87,6 +87,6 @@ INSTALL_LIBGCC = install-multilib
TCFLAGS = -mno-app-regs -msmall-sld -Wa,-mwarn-signed-overflow -Wa,-mwarn-unsigned-overflow
-v850-c.o: $(srcdir)/config/v850/v850-c.c $(RTL_H) $(TREE_H) $(CONFIG_H) $(TM_P_H)
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
-
+v850-c.o: $(srcdir)/config/v850/v850-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(CPPLIB_H) $(TREE_H) c-pragma.h toplev.h $(GGC_H) $(TM_P_H)
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/v850/v850-c.c
diff --git a/gcc/config/v850/v850-c.c b/gcc/config/v850/v850-c.c
index 8f43930fc5a..431114edfdb 100644
--- a/gcc/config/v850/v850-c.c
+++ b/gcc/config/v850/v850-c.c
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "cpplib.h"
#include "tree.h"
#include "c-pragma.h"
diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index 8029ecfd021..dcbb644ae2a 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -22,6 +22,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "regs.h"
diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h
index b04b59ef690..aab4dd94d0b 100644
--- a/gcc/config/v850/v850.h
+++ b/gcc/config/v850/v850.h
@@ -1264,13 +1264,7 @@ zbss_section () \
#define ASM_OUTPUT_LABELREF(FILE, NAME) \
asm_fprintf (FILE, "%U%s", (*targetm.strip_name_encoding) (NAME))
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
+#define ASM_PN_FORMAT "%s___%lu"
/* This is how we tell the assembler that two symbols have the same value. */
diff --git a/gcc/config/vax/vax-protos.h b/gcc/config/vax/vax-protos.h
index 6e3a291c228..307f5eb40ef 100644
--- a/gcc/config/vax/vax-protos.h
+++ b/gcc/config/vax/vax-protos.h
@@ -35,8 +35,7 @@ extern int check_float_value PARAMS ((enum machine_mode, REAL_VALUE_TYPE *, int)
#endif /* REAL_VALUE_TYPE */
#ifdef TREE_CODE
-extern void vms_check_external PARAMS ((tree, const char *, int));
+extern void vax_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
#endif /* TREE_CODE */
-extern void vms_flush_pending_externals PARAMS ((FILE *));
extern void const_section PARAMS ((void));
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index 7db62115683..69b175fd818 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "regs.h"
@@ -41,13 +43,6 @@ Boston, MA 02111-1307, USA. */
static int follows_p PARAMS ((rtx, rtx));
static void vax_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-#if VMS_TARGET
-static void vms_asm_out_constructor PARAMS ((rtx, int));
-static void vms_asm_out_destructor PARAMS ((rtx, int));
-static void vms_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT));
-static void vms_encode_section_info PARAMS ((tree, int));
-static void vms_globalize_label PARAMS ((FILE *, const char *));
-#endif
static void vax_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
@@ -58,15 +53,6 @@ static void vax_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE vax_output_function_prologue
-#if VMS_TARGET
-#undef TARGET_ASM_SELECT_SECTION
-#define TARGET_ASM_SELECT_SECTION vms_select_section
-#undef TARGET_ENCODE_SECTION_INFO
-#define TARGET_ENCODE_SECTION_INFO vms_encode_section_info
-#undef TARGET_ASM_GLOBALIZE_LABEL
-#define TARGET_ASM_GLOBALIZE_LABEL vms_globalize_label
-#endif
-
#undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK vax_output_mi_thunk
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
@@ -124,19 +110,6 @@ vax_output_function_prologue (file, size)
dwarf2out_def_cfa (label, FRAME_POINTER_REGNUM, -(offset - 4));
}
- if (VMS_TARGET)
- {
- /* Adjusting the stack pointer by 4 before calling C$MAIN_ARGS
- is required when linking with the VMS POSIX version of the C
- run-time library; using `subl2 $4,r0' is adequate but we use
- `clrl -(sp)' instead. The extra 4 bytes could be removed
- after the call because STARTING_FRAME_OFFSET's setting of -4
- will end up adding them right back again, but don't bother. */
-
- if (MAIN_NAME_P (DECL_NAME (current_function_decl)))
- asm_fprintf (file, "\tclrl -(%Rsp)\n\tjsb _C$MAIN_ARGS\n");
- }
-
size -= STARTING_FRAME_OFFSET;
if (size >= 64)
asm_fprintf (file, "\tmovab %d(%Rsp),%Rsp\n", -size);
@@ -706,265 +679,6 @@ vax_rtx_cost (x)
return c;
}
-#if VMS_TARGET
-/* Additional support code for VMS target. */
-
-/* Linked list of all externals that are to be emitted when optimizing
- for the global pointer if they haven't been declared by the end of
- the program with an appropriate .comm or initialization. */
-
-static
-struct extern_list {
- struct extern_list *next; /* next external */
- const char *name; /* name of the external */
- int size; /* external's actual size */
- int in_const; /* section type flag */
-} *extern_head = 0, *pending_head = 0;
-
-/* Check whether NAME is already on the external definition list. If not,
- add it to either that list or the pending definition list. */
-
-void
-vms_check_external (decl, name, pending)
- tree decl;
- const char *name;
- int pending;
-{
- register struct extern_list *p, *p0;
-
- for (p = extern_head; p; p = p->next)
- if (!strcmp (p->name, name))
- return;
-
- for (p = pending_head, p0 = 0; p; p0 = p, p = p->next)
- if (!strcmp (p->name, name))
- {
- if (pending)
- return;
-
- /* Was pending, but has now been defined; move it to other list. */
- if (p == pending_head)
- pending_head = p->next;
- else
- p0->next = p->next;
- p->next = extern_head;
- extern_head = p;
- return;
- }
-
- /* Not previously seen; create a new list entry. */
- p = (struct extern_list *) xmalloc (sizeof (struct extern_list));
- p->name = name;
-
- if (pending)
- {
- /* Save the size and section type and link to `pending' list. */
- p->size = (DECL_SIZE (decl) == 0) ? 0 :
- TREE_INT_CST_LOW (size_binop (CEIL_DIV_EXPR, DECL_SIZE (decl),
- size_int (BITS_PER_UNIT)));
- p->in_const = (TREE_READONLY (decl) && ! TREE_THIS_VOLATILE (decl));
-
- p->next = pending_head;
- pending_head = p;
- }
- else
- {
- /* Size and section type don't matter; link to `declared' list. */
- p->size = p->in_const = 0; /* arbitrary init */
-
- p->next = extern_head;
- extern_head = p;
- }
- return;
-}
-
-void
-vms_flush_pending_externals (file)
- FILE *file;
-{
- register struct extern_list *p;
-
- while (pending_head)
- {
- /* Move next pending declaration to the "done" list. */
- p = pending_head;
- pending_head = p->next;
- p->next = extern_head;
- extern_head = p;
-
- /* Now output the actual declaration. */
- if (p->in_const)
- const_section ();
- else
- data_section ();
- fputs (".comm ", file);
- assemble_name (file, p->name);
- fprintf (file, ",%d\n", p->size);
- }
-}
-
-static void
-vms_asm_out_constructor (symbol, priority)
- rtx symbol;
- int priority ATTRIBUTE_UNUSED;
-{
- fprintf (asm_out_file,".globl $$PsectAttributes_NOOVR$$__gxx_init_1\n");
- data_section();
- fprintf (asm_out_file,"$$PsectAttributes_NOOVR$$__gxx_init_1:\n\t.long\t");
- assemble_name (asm_out_file, XSTR (symbol, 0));
- fputc ('\n', asm_out_file);
-}
-
-static void
-vms_asm_out_destructor (symbol, priority)
- rtx symbol;
- int priority ATTRIBUTE_UNUSED;
-{
- fprintf (asm_out_file,".globl $$PsectAttributes_NOOVR$$__gxx_clean_1\n");
- data_section();
- fprintf (asm_out_file,"$$PsectAttributes_NOOVR$$__gxx_clean_1:\n\t.long\t");
- assemble_name (asm_out_file, XSTR (symbol, 0));
- fputc ('\n', asm_out_file);
-}
-
-static void
-vms_select_section (exp, reloc, align)
- tree exp;
- int reloc ATTRIBUTE_UNUSED;
- unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
-{
- if (TREE_CODE (exp) == VAR_DECL)
- {
- if (TREE_READONLY (exp) && ! TREE_THIS_VOLATILE (exp)
- && DECL_INITIAL (exp)
- && (DECL_INITIAL (exp) == error_mark_node
- || TREE_CONSTANT (DECL_INITIAL (exp))))
- {
- if (TREE_PUBLIC (exp))
- const_section ();
- else
- text_section ();
- }
- else
- data_section ();
- }
- if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'c')
- {
- if (TREE_CODE (exp) == STRING_CST && flag_writable_strings)
- data_section ();
- else
- text_section ();
- }
-}
-
-/* Make sure that external variables are correctly addressed. Under VMS
- there is some brain damage in the linker that requires us to do this. */
-
-static void
-vms_encode_section_info (decl, first)
- tree decl;
- int first ATTRIBUTE_UNUSED;
-{
- if (DECL_EXTERNAL (decl) && TREE_PUBLIC (decl))
- SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
-}
-
-/* This is how to output a command to make the user-level label named NAME
- defined for reference from other files. */
-static void
-vms_globalize_label (stream, name)
- FILE *stream;
- const char *name;
-{
- default_globalize_label (stream, name);
- vms_check_external (NULL_TREE, name, 0);
-}
-#endif /* VMS_TARGET */
-
-/* Additional support code for VMS host. */
-/* ??? This should really be in libiberty; vax.c is a target file. */
-#ifdef QSORT_WORKAROUND
- /*
- Do not use VAXCRTL's qsort() due to a severe bug: once you've
- sorted something which has a size that's an exact multiple of 4
- and is longword aligned, you cannot safely sort anything which
- is either not a multiple of 4 in size or not longword aligned.
- A static "move-by-longword" optimization flag inside qsort() is
- never reset. This is known to affect VMS V4.6 through VMS V5.5-1,
- and was finally fixed in VMS V5.5-2.
-
- In this work-around an insertion sort is used for simplicity.
- The qsort code from glibc should probably be used instead.
- */
-void
-not_qsort (array, count, size, compare)
- void *array;
- unsigned count, size;
- int (*compare)();
-{
-
- if (size == sizeof (short))
- {
- register int i;
- register short *next, *prev;
- short tmp, *base = array;
-
- for (next = base, i = count - 1; i > 0; i--)
- {
- prev = next++;
- if ((*compare)(next, prev) < 0)
- {
- tmp = *next;
- do *(prev + 1) = *prev;
- while (--prev >= base ? (*compare)(&tmp, prev) < 0 : 0);
- *(prev + 1) = tmp;
- }
- }
- }
- else if (size == sizeof (long))
- {
- register int i;
- register long *next, *prev;
- long tmp, *base = array;
-
- for (next = base, i = count - 1; i > 0; i--)
- {
- prev = next++;
- if ((*compare)(next, prev) < 0)
- {
- tmp = *next;
- do *(prev + 1) = *prev;
- while (--prev >= base ? (*compare)(&tmp, prev) < 0 : 0);
- *(prev + 1) = tmp;
- }
- }
- }
- else /* arbitrary size */
- {
- register int i;
- register char *next, *prev, *tmp = alloca (size), *base = array;
-
- for (next = base, i = count - 1; i > 0; i--)
- { /* count-1 forward iterations */
- prev = next, next += size; /* increment front pointer */
- if ((*compare)(next, prev) < 0)
- { /* found element out of order; move others up then re-insert */
- memcpy (tmp, next, size); /* save smaller element */
- do { memcpy (prev + size, prev, size); /* move larger elem. up */
- prev -= size; /* decrement back pointer */
- } while (prev >= base ? (*compare)(tmp, prev) < 0 : 0);
- memcpy (prev + size, tmp, size); /* restore small element */
- }
- }
-#ifdef USE_C_ALLOCA
- alloca (0);
-#endif
- }
-
- return;
-}
-#endif /* QSORT_WORKAROUND */
-
/* Return 1 if insn A follows B. */
static int
diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h
index 47a0f034e69..ec08c0eeb55 100644
--- a/gcc/config/vax/vax.h
+++ b/gcc/config/vax/vax.h
@@ -557,10 +557,8 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
/* Addressing modes, and classification of registers for them. */
#define HAVE_POST_INCREMENT 1
-/* #define HAVE_POST_DECREMENT 0 */
#define HAVE_PRE_DECREMENT 1
-/* #define HAVE_PRE_INCREMENT 0 */
/* Macros to check register numbers against specific register classes. */
@@ -1060,12 +1058,6 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
#define USER_LABEL_PREFIX "_"
-/* This is how to output an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class. */
-
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- fprintf (FILE, "%s%d:\n", PREFIX, NUM)
-
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
@@ -1147,6 +1139,14 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
assemble_name ((FILE), (NAME)), \
fprintf ((FILE), ",%u\n", (ROUNDED)))
+/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
+ Used for C++ multiple inheritance.
+ .mask ^m<r2,r3,r4,r5,r6,r7,r8,r9,r10,r11> #conservative entry mask
+ addl2 $DELTA, 4(ap) #adjust first argument
+ jmp FUNCTION+2 #jump beyond FUNCTION's entry mask
+ */
+#define ASM_OUTPUT_MI_THUNK vax_output_mi_thunk
+
/* Store in OUTPUT a string (made with alloca) containing
an assembler-name for a local static variable named NAME.
LABELNO is an integer which is different for each call. */
diff --git a/gcc/config/vax/vms.h b/gcc/config/vax/vms.h
deleted file mode 100644
index 870ebaf04eb..00000000000
--- a/gcc/config/vax/vms.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/* Output variables, constants and external declarations, for GNU compiler.
- Copyright (C) 1988, 1994, 1995, 1996, 1997, 1999, 2001, 2002
- 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 TARGET_EXECUTABLE_SUFFIX ".exe"
-#define TARGET_OBJECT_SUFFIX ".obj"
-
-/* This enables certain macros in vax.h, which will make an indirect
- reference to an external symbol an invalid address. This needs to be
- defined before we include vax.h, since it determines which macros
- are used for GO_IF_*. */
-
-#define NO_EXTERNAL_INDIRECT_ADDRESS
-
-#include "vax/vax.h"
-
-#undef VMS_TARGET
-#define VMS_TARGET 1
-
-#undef LIB_SPEC
-#undef TARGET_NAME
-#undef TARGET_DEFAULT
-#undef CALL_USED_REGISTERS
-#undef STARTING_FRAME_OFFSET
-
-#define TARGET_OS_CPP_BUILTINS() \
- do \
- { \
- builtin_define_std ("vms"); \
- builtin_define_std ("VMS"); \
- builtin_assert ("system=vms"); \
- \
- builtin_define_std ("vax"); \
- if (TARGET_G_FLOAT) \
- builtin_define_std ("GFLOAT"); \
- } \
- while (0)
-
-/* These match the definitions used in VAXCRTL, the VMS C run-time library */
-
-#define SIZE_TYPE "unsigned int"
-#define PTRDIFF_TYPE "int"
-#define WCHAR_TYPE "unsigned int"
-#define WCHAR_TYPE_SIZE 32 /* in bits */
-
-/* Use memcpy for structure copying, and so forth. */
-#define TARGET_MEM_FUNCTIONS
-
-/* Strictly speaking, VMS does not use DBX at all, but the interpreter built
- into gas only speaks straight DBX. */
-
-#define DEFAULT_GDB_EXTENSIONS 0
-
-#define TARGET_DEFAULT 1
-#define TARGET_NAME "vax/vms"
-
-/* The structure return address arrives as an "argument" on VMS. */
-#undef STRUCT_VALUE_REGNUM
-#define STRUCT_VALUE 0
-#undef PCC_STATIC_STRUCT_RETURN
-
-#define CALL_USED_REGISTERS {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1}
-
-/* The run-time library routine VAXC$ESTABLISH (necessary when mixing
- VMS exception handling and setjmp/longjmp in the same program) requires
- that a hidden automatic variable at the top of the stack be reserved
- for its use. We accomplish this by simply adding 4 bytes to the local
- stack for all functions, and making sure that normal local variables
- are 4 bytes lower on the stack then they would otherwise have been. */
-
-#define STARTING_FRAME_OFFSET -4
-
-/* This macro definition sets up a default value for `main' to return. */
-#define DEFAULT_MAIN_RETURN c_expand_return (integer_one_node)
-
-/* Globalizing directive for a label. */
-#define GLOBAL_ASM_OP ".globl "
-
-/* Under VMS we write the actual size of the storage to be allocated even
- though the symbol is external. Although it is possible to give external
- symbols a size of 0 (as unix does), the VMS linker does not make the
- distinction between a variable definition and an external reference of a
- variable, and thus the linker will not complain about a missing definition.
- If we followed the unix example of giving external symbols a size of
- zero, you tried to link a program where a given variable was externally
- defined but none of the object modules contained a non-extern definition,
- the linker would allocate 0 bytes for the variable, and any attempt to
- use that variable would use the storage allocated to some other variable.
-
- We must also select either const_section or data_section: this will indicate
- whether or not the variable will get the readonly bit set. Since the
- VMS linker does not distinguish between a variable's definition and an
- external reference, all usages of a given variable must have the readonly
- bit set the same way, or the linker will get confused and give warning
- messages. */
-
-/* We used to round the size up to a multiple of 4,
- but that causes linker errors sometimes when the variable was initialized
- since the size of its definition was not likewise rounded up. */
-
-/* Note: the original ASM_OUTPUT_EXTERNAL code has been moved into
- vms_check_external and vms_flush_pending_externals. */
-
-#define ASM_OUTPUT_EXTERNAL(FILE,DECL,NAME) \
-{ if (DECL_INITIAL (DECL) == 0 && TREE_CODE (DECL) != FUNCTION_DECL) \
- vms_check_external ((DECL), (NAME), 1); \
-}
-
-/* ASM_OUTPUT_EXTERNAL will have wait until after an initializer is
- completed in order to switch sections for an external object, so
- use the DECLARE_OBJECT hooks to manage deferred declarations. */
-
-/* This is the default action for ASM_DECLARE_OBJECT_NAME, but if it
- is explicitly defined, then ASM_FINISH_DECLARE_OBJECT will be used. */
-
-#define ASM_DECLARE_OBJECT_NAME(ASM_OUT_FILE,NAME,DECL) \
- ASM_OUTPUT_LABEL ((ASM_OUT_FILE), (NAME))
-
-/* We don't need to do anything special to finish the current object, but it
- should now be safe to output any deferred external global declarations. */
-
-#define ASM_FINISH_DECLARE_OBJECT(FILE,DECL,TOPLVL,ATEND) \
- vms_flush_pending_externals(FILE)
-
-/* Anything still pending must be flushed at the very end. */
-
-#define ASM_FILE_END(STREAM) \
- vms_flush_pending_externals(STREAM)
-
-/* Here we redefine ASM_OUTPUT_COMMON to select the data_section or the
- const_section before writing the ".const" assembler directive.
- If we were specifying a size of zero for external variables, we would
- not have to select a section, since the assembler can assume that
- when the size > 0, the storage is for a non-external, uninitialized
- variable (for which a "const" declaration would be senseless),
- and the assembler can make the storage read/write.
-
- Since the ".const" directive specifies the actual size of the storage used
- for both external and non-external variables, the assembler cannot
- make this assumption, and thus it has no way of deciding if storage should
- be read/write or read-only. To resolve this, we give the assembler some
- assistance, in the form of a ".const" or a ".data" directive.
-
- Under GCC 1.40, external variables were declared with a size of zero.
- The GNU assembler, GAS, will recognize the "-2" switch when built for VMS;
- when compiling programs with GCC 2.n this switch should be used or the
- assembler will not give the read-only attribute to external constants.
- Failure to use this switch will result in linker warning messages about
- mismatched psect attributes. */
-
-#undef ASM_OUTPUT_COMMON
-
-#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
-( ((TREE_READONLY (decl) && ! TREE_THIS_VOLATILE (decl)) \
- ? (const_section (), 0) : (data_section (), 0)), \
- fputs (".comm ", (FILE)), \
- assemble_name ((FILE), (NAME)), \
- fprintf ((FILE), ",%u\n", (SIZE)))
-
-/* We define this to prevent the name mangler from putting dollar signs into
- function names. This isn't really needed, but it has been here for
- some time and removing it would cause the object files generated by the
- compiler to be incompatible with the object files from a compiler that
- had this defined. Since it does no harm, we leave it in. */
-
-#define NO_DOLLAR_IN_LABEL
-
-/* Add a "const" section. This is viewed by the assembler as being nearly
- the same as the "data" section, with the only difference being that a
- flag is set for variables declared while in the const section. This
- flag is used to determine whether or not the read/write bit should be
- set in the Psect definition. */
-
-#define EXTRA_SECTIONS in_const
-
-#define EXTRA_SECTION_FUNCTIONS \
-void \
-const_section () \
-{ \
- if (in_section != in_const) { \
- fprintf(asm_out_file,".const\n"); \
- in_section = in_const; \
- } \
-}
-
-/* This is used by a hook in varasm.c to write the assembler directives
- that are needed to tell the startup code which constructors need to
- be run. */
-
-#define TARGET_ASM_CONSTRUCTOR vms_asm_out_constructor
-#define TARGET_ASM_DESTRUCTOR vms_asm_out_destructor
-
-/* The following definitions are used in libgcc2.c with the __main
- function. The _SHR symbol is used when the sharable image library
- for the C++ library is used - this is picked up automatically by the linker
- and this symbol points to the start of __CTOR_LIST__ from the C++ library.
- If the C++ library is not used, then __CTOR_LIST_SHR__ occurs just after
- __CTOR_LIST__, and essentially points to the same list as __CTOR_LIST. */
-
-#ifdef L__main
-
-#define __CTOR_LIST__ __gxx_init_0
-#define __CTOR_LIST_END__ __gxx_init_2
-
-#define __CTOR_LIST_SHR__ $$PsectAttributes_NOSHR$$__gxx_init_0_shr
-#define __CTOR_LIST_SHR_END__ $$PsectAttributes_NOSHR$$__gxx_init_2_shr
-
-#define DO_GLOBAL_CTORS_BODY \
-do { \
- func_ptr *p; \
- extern func_ptr __CTOR_LIST__[1], __CTOR_LIST_END__[1]; \
- extern func_ptr __CTOR_LIST_SHR__[1], __CTOR_LIST_SHR_END__[1]; \
- if (&__CTOR_LIST_SHR__[0] != &__CTOR_LIST__[1]) \
- for (p = __CTOR_LIST_SHR__ + 1; p < __CTOR_LIST_SHR_END__ ; p++ ) \
- if (*p) (*p) (); \
- for (p = __CTOR_LIST__ + 1; p < __CTOR_LIST_END__ ; p++ ) \
- if (*p) (*p) (); \
- do { /* arrange for `return' from main() to pass through exit() */ \
- __label__ foo; \
- int *callers_caller_fp = (int *) __builtin_frame_address (3); \
- register int retval asm ("r0"); \
- callers_caller_fp[4] = (int) && foo; \
- break; /* out of do-while block */ \
- foo: \
- exit (retval); \
- } while (0); \
-} while (0)
-
-#define __DTOR_LIST__ __gxx_clean_0
-#define __DTOR_LIST_END__ __gxx_clean_2
-
-#define __DTOR_LIST_SHR__ $$PsectAttributes_NOSHR$$__gxx_clean_0_shr
-#define __DTOR_LIST_SHR_END__ $$PsectAttributes_NOSHR$$__gxx_clean_2_shr
-
-#define DO_GLOBAL_DTORS_BODY \
-do { \
- func_ptr *p; \
- extern func_ptr __DTOR_LIST__[1], __DTOR_LIST_END__[1]; \
- extern func_ptr __DTOR_LIST_SHR__[1], __DTOR_LIST_SHR_END__[1]; \
- for (p = __DTOR_LIST__ + 1; p < __DTOR_LIST_END__ ; p++ ) \
- if (*p) (*p) (); \
- if (&__DTOR_LIST_SHR__[0] != &__DTOR_LIST__[1]) \
- for (p = __DTOR_LIST_SHR__ + 1; p < __DTOR_LIST_SHR_END__ ; p++ ) \
- if (*p) (*p) (); \
-} while (0)
-
-#endif /* L__main */
-
-/* Specify the list of include file directories. */
-#define INCLUDE_DEFAULTS \
-{ \
- { "GNU_GXX_INCLUDE:", "G++", 1, 1 }, \
- { "GNU_CC_INCLUDE:", "GCC", 0, 0 }, /* GNU includes */ \
- { "SYS$SYSROOT:[SYSLIB.]", 0, 0, 0 }, /* VAX-11 "C" includes */ \
- { ".", 0, 0, 1 }, /* Make normal VMS filespecs work. */ \
- { 0, 0, 0, 0 } \
-}
diff --git a/gcc/config/vax/xm-vms.h b/gcc/config/vax/xm-vms.h
deleted file mode 100644
index eaf5f3bf510..00000000000
--- a/gcc/config/vax/xm-vms.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/* Configuration for GNU C-compiler for VAX.
- Copyright (C) 1987, 1994, 1995, 1996, 1997, 2001
- 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. */
-
-/* Other configurations get these via autoconfig. */
-#define STDC_HEADERS 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STRING_H 1
-#ifdef __DECC
-#define HAVE_UNISTD_H 1
-#endif
-
-#if defined(VAXC) || defined(__DECC)
-/* if compiling with VAXC, need to fix problem with <stdio.h>
- which defines a macro called FILE_TYPE that breaks "tree.h".
- Fortunately it uses #ifndef to suppress multiple inclusions.
- Three possible cases:
- 1) <stdio.h> has already been included -- ours will be no-op;
- 2) <stdio.h> will be included after us -- "theirs" will be no-op;
- 3) <stdio.h> isn't needed -- including it here shouldn't hurt.
- In all three cases, the problem macro will be removed here. */
-#include <stdio.h>
-#undef FILE_TYPE
-#endif
-
-#define SUCCESS_EXIT_CODE 1
-#define FATAL_EXIT_CODE (44 | 0x10000000) /* Abort, and no DCL message. */
-
-/* A couple of conditionals for execution machine are controlled here. */
-#ifndef VMS
-#define VMS
-#endif
-
-#define GCC_INCLUDE_DIR "///not used with VMS///" /* nonsense string for now */
-
-/* and define a local equivalent (sort of) for unlink */
-#define unlink remove
-
-/* Under VMS a directory specification can be enclosed either in square
- brackets or in angle brackets. Thus we need to check both. This
- macro is used to help compare filenames in cp-lex.c.
-
- We also need to make sure that the names are all lower case, because
- we must be able to compare filenames to determine if a file implements
- a class. */
-
-#define FILE_NAME_NONDIRECTORY(C) \
-({ \
- char * pnt_ = (C), * pnt1_; \
- pnt1_ = pnt_ - 1; \
- while (*++pnt1_) \
- if (ISUPPER (*pnt1_)) *pnt1_ = TOLOWER (*pnt1_); \
- pnt1_ = strrchr (pnt_, ']'); \
- pnt1_ = (pnt1_ == 0 ? strrchr (pnt_, '>') : pnt1_); \
- pnt1_ = (pnt1_ == 0 ? strrchr (pnt_, ':') : pnt1_); \
- (pnt1_ == 0 ? pnt_ : pnt1_ + 1); \
- })
-
-/* Macro to generate the name of the cross reference file. The standard
- one does not work, since it was written assuming that the conventions
- of a unix style filesystem will work on the host system. */
-
-#define XREF_FILE_NAME(BUFF, NAME) \
- s = FILE_NAME_NONDIRECTORY (NAME); \
- if (s == NAME) sprintf(BUFF, "%s_gxref", NAME); \
- else { \
- strcpy(BUFF, NAME); \
- strcat(BUFF, "_gxref"); \
- }
-
-/* Macro that is used in cp-xref.c to determine whether a file name is
- absolute or not. */
-
-#define FILE_NAME_ABSOLUTE_P(NAME) \
- (FILE_NAME_NONDIRECTORY (NAME) != (&NAME[1]))
-
-/* FILE_NAME_JOINER is defined to be the characters that are inserted between
- a directory name and a filename in order to make an absolute file
- specification. Under VMS the directory specification contains all of the
- required characters, so we define this to be a null string. */
-
-#define FILE_NAME_JOINER ""
-
-/* vprintf() has been available since VMS V4.6. */
-
-#define HAVE_VPRINTF
-
-/* Early versions of VAX C for VMS do not have putenv. Comment out
- the following define if your system doesn't have putenv. */
-#define HAVE_PUTENV
-
-#ifndef HAVE_PUTENV
-#define putenv(x)
-#endif
-
-#if defined(VAXC) || defined(__DECC)
-
-/* Customizations/kludges for building with DEC's VAX C compiler
- rather than GCC. */
-
-#define QSORT_WORKAROUND /* do not use VAXCRTL's qsort */
-
-/* use ANSI/SYSV style byte manipulation routines instead of BSD ones */
-/* rename all too-long external symbol names to avoid warnings */
-#define check_for_full_enumeration_handling check_for_full_enum_handling
-#define current_function_contains_functions curfunc_contains_functions
-#define current_function_epilogue_delay_list curfunc_epilogue_delay_list
-#define current_function_has_nonlocal_goto curfunc_has_nonlocal_goto
-#define current_function_has_nonlocal_label curfunc_has_nonlocal_label
-#define current_function_internal_arg_pointer curfunc_internal_arg_pointer
-#define current_function_outgoing_args_size curfunc_outgoing_args_size
-#define current_function_pretend_args_size curfunc_pretend_args_size
-#define current_function_returns_pcc_struct curfunc_returns_pcc_struct
-#define current_function_returns_pointer curfunc_returns_pointer
-#define current_function_uses_const_pool curfunc_uses_const_pool
-#define current_function_uses_pic_offset_table curfunc_uses_pic_offset_table
-#define dbxout_resume_previous_source_file dbxout_resume_previous_src_file
-#define expand_builtin_extract_return_addr expand_builtin_extract_ret_addr
-#define expand_builtin_set_return_addr_reg expand_builtin_set_ret_addr_reg
-#define expand_start_loop_continue_elsewhere expnd_start_loop_cont_elsewhere
-#define flag_schedule_insns_after_reload flag_sched_insns_after_reload
-#define get_dynamic_handler_chain_libfunc get_dynamic_hndlr_chain_libfunc
-#define lookup_name_current_level_global lookup_name_current_level_gbl
-#define maybe_building_objc_message_expr maybe_building_objc_msg_expr
-#define mesg_implicit_function_declaration mesg_implicit_func_declaration
-#define output_deferred_addressed_constants output_deferred_addr_constants
-#define protect_cleanup_actions_with_terminate protect_cleanup_act_w_terminate
-#define reg_overlap_mentioned_for_reload_p reg_overlap_mtnd_for_reload_p
-#define reposition_prologue_and_epilogue_notes repos_prolog_and_epilog_notes
-#define rtx_equal_function_value_matters rtx_equal_func_value_matters
-#define set_new_first_and_last_label_num set_new_first_and_last_lbl_num
-#define thread_prologue_and_epilogue_insns thread_prolog_and_epilog_insns
-#endif
-
-/* We need to avoid the library qsort routine, due to a serious bug
- in VAXCRTL. (Sorting anything with size that's not a multiple of 4
- after having previously sorted something that was a multiple of 4
- can produce wrong results and result in data corruption.) We'll
- use our own substitute (in vax.c) instead. */
-#ifdef QSORT_WORKAROUND
-#define qsort not_qsort
-#endif
-
-#ifdef __DECC
-/* DECC$SHR doesn't have VAXCRTL's bugs. */
-#undef QSORT_WORKAROUND
-#undef qsort
-/* Avoid a lot of informational level diagnostics about implicitly
- declared functions. */
-#include <stdlib.h>
-#include <string.h>
-/* this is for genopinit.c */
- #pragma message disable (undefescap)
-#endif
-
-#define HOST_EXECUTABLE_SUFFIX ".exe"
-#define HOST_OBJECT_SUFFIX ".obj"
diff --git a/gcc/config/vxlib.c b/gcc/config/vxlib.c
new file mode 100644
index 00000000000..89e0c3514d9
--- /dev/null
+++ b/gcc/config/vxlib.c
@@ -0,0 +1,325 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+ Contributed by Zack Weinberg <zack@codesourcery.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 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. */
+
+/* Threads compatibility routines for libgcc2 for VxWorks.
+ These are out-of-line routines called from gthr-vxworks.h. */
+
+/* As a special exception, if you link this library with other files,
+ some of which are compiled with GCC, to produce an executable,
+ this library 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 General Public License. */
+
+#include "tconfig.h"
+#include "tsystem.h"
+#include "gthr.h"
+
+#include <vxWorks.h>
+#include <vxLib.h>
+#include <taskLib.h>
+#include <taskHookLib.h>
+
+/* Init-once operation.
+
+ This would be a clone of the implementation from gthr-solaris.h,
+ except that we have a bootstrap problem - the whole point of this
+ exercise is to prevent double initialization, but if two threads
+ are racing with each other, once->mutex is liable to be initialized
+ by both. Then each thread will lock its own mutex, and proceed to
+ call the initialization routine.
+
+ So instead we use a bare atomic primitive (vxTas()) to handle
+ mutual exclusion. Threads losing the race then busy-wait, calling
+ taskDelay() to yield the processor, until the initialization is
+ completed. Inefficient, but reliable. */
+
+int
+__gthread_once (__gthread_once_t *guard, void (*func)(void))
+{
+ if (guard->done)
+ return 0;
+
+ while (!vxTas ((void *)&guard->busy))
+ taskDelay (1);
+
+ /* Only one thread at a time gets here. Check ->done again, then
+ go ahead and call func() if no one has done it yet. */
+ if (!guard->done)
+ {
+ func ();
+ guard->done = 1;
+ }
+
+ guard->busy = 0;
+ return 0;
+}
+
+/* Thread-specific data.
+
+ We reserve a field in the TCB to point to a dynamically allocated
+ array which is used to store TSD values. A TSD key is simply an
+ offset in this array. The exact location of the TCB field is not
+ known to this code nor to vxlib.c -- all access to it indirects
+ through the routines __gthread_get_tsd_data and
+ __gthread_set_tsd_data, which are provided by the VxWorks kernel.
+
+ There is also a global array which records which keys are valid and
+ which have destructors.
+
+ A task delete hook is installed to execute key destructors. The
+ routines __gthread_enter_tsd_dtor_context and
+ __gthread_leave_tsd_dtor_context, which are also provided by the
+ kernel, ensure that it is safe to call free() on memory allocated
+ by the task being deleted. (This is a no-op on VxWorks 5, but
+ a major undertaking on AE.)
+
+ Since this interface is used to allocate only a small number of
+ keys, the table size is small and static, which simplifies the
+ code quite a bit. Revisit this if and when it becomes necessary. */
+
+#define MAX_KEYS 4
+
+/* This is the structure pointed to by the pointer returned
+ by __gthread_get_tsd_data. */
+struct tsd_data
+{
+ void *values[MAX_KEYS];
+ unsigned int generation[MAX_KEYS];
+};
+
+
+/* kernel provided routines */
+extern void *__gthread_get_tsd_data (WIND_TCB *tcb);
+extern void __gthread_set_tsd_data (WIND_TCB *tcb, void *data);
+
+extern void __gthread_enter_tsd_dtor_context (WIND_TCB *tcb);
+extern void __gthread_leave_tsd_dtor_context (WIND_TCB *tcb);
+
+typedef void (*fet_callback_t) (WIND_TCB *, unsigned int);
+extern void __gthread_for_all_tasks (fet_callback_t fun, unsigned int number);
+
+/* This is a global structure which records all of the active keys.
+
+ A key is potentially valid (i.e. has been handed out by
+ __gthread_key_create) iff its generation count in this structure is
+ even. In that case, the matching entry in the dtors array is a
+ routine to be called when a thread terminates with a valid,
+ non-NULL specific value for that key.
+
+ A key is actually valid in a thread T iff the generation count
+ stored in this structure is equal to the generation count stored in
+ T's specific-value structure. */
+
+typedef void (*tsd_dtor) (void *);
+
+struct tsd_keys
+{
+ tsd_dtor dtor[MAX_KEYS];
+ unsigned int generation[MAX_KEYS];
+};
+
+#define KEY_VALID_P(key) !(tsd_keys.generation[key] & 1)
+
+/* Note: if MAX_KEYS is increased, this initializer must be updated
+ to match. All the generation counts begin at 1, which means no
+ key is valid. */
+static struct tsd_keys tsd_keys =
+{
+ { 0, 0, 0, 0 },
+ { 1, 1, 1, 1 }
+};
+
+/* This lock protects the tsd_keys structure. */
+static __gthread_mutex_t tsd_lock;
+
+static __gthread_once_t tsd_init_guard = __GTHREAD_ONCE_INIT;
+
+/* Internal routines. */
+
+/* The task TCB has just been deleted. Call the destructor
+ function for each TSD key that has both a destructor and
+ a non-NULL specific value in this thread.
+
+ This routine does not need to take tsd_lock; the generation
+ count protects us from calling a stale destructor. It does
+ need to read tsd_keys.dtor[key] atomically. */
+
+static void
+tsd_delete_hook (WIND_TCB *tcb)
+{
+ struct tsd_data *data = __gthread_get_tsd_data (tcb);
+ __gthread_key_t key;
+
+ if (data)
+ {
+ __gthread_enter_tsd_dtor_context (tcb);
+ for (key = 0; key < MAX_KEYS; key++)
+ {
+ if (data->generation[key] == tsd_keys.generation[key])
+ {
+ tsd_dtor dtor = tsd_keys.dtor[key];
+
+ if (dtor)
+ dtor (data->values[key]);
+ }
+ }
+ free (data);
+ __gthread_set_tsd_data (tcb, 0);
+ __gthread_leave_tsd_dtor_context (tcb);
+ }
+}
+
+/* Initialize global data used by the TSD system. */
+static void
+tsd_init (void)
+{
+ taskDeleteHookAdd ((FUNCPTR)tsd_delete_hook);
+ __GTHREAD_MUTEX_INIT_FUNCTION (&tsd_lock);
+}
+
+/* External interface */
+
+/* Store in KEYP a value which can be passed to __gthread_setspecific/
+ __gthread_getspecific to store and retrive 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. */
+
+int
+__gthread_key_create (__gthread_key_t *keyp, tsd_dtor dtor)
+{
+ __gthread_key_t key;
+
+ __gthread_once (&tsd_init_guard, tsd_init);
+
+ if (__gthread_mutex_lock (&tsd_lock) == ERROR)
+ return errno;
+
+ for (key = 0; key < MAX_KEYS; key++)
+ if (!KEY_VALID_P (key))
+ goto found_slot;
+
+ /* no room */
+ __gthread_mutex_unlock (&tsd_lock);
+ return EAGAIN;
+
+ found_slot:
+ tsd_keys.generation[key]++; /* making it even */
+ tsd_keys.dtor[key] = dtor;
+ *keyp = key;
+ __gthread_mutex_unlock (&tsd_lock);
+ return 0;
+}
+
+/* Invalidate KEY; it can no longer be used as an argument to
+ setspecific/getspecific. Note that this does NOT call destructor
+ functions for any live values for this key. */
+int
+__gthread_key_delete (__gthread_key_t key)
+{
+ if (key >= MAX_KEYS)
+ return EINVAL;
+
+ __gthread_once (&tsd_init_guard, tsd_init);
+
+ if (__gthread_mutex_lock (&tsd_lock) == ERROR)
+ return errno;
+
+ if (!KEY_VALID_P (key))
+ {
+ __gthread_mutex_unlock (&tsd_lock);
+ return EINVAL;
+ }
+
+ tsd_keys.generation[key]++; /* making it odd */
+ tsd_keys.dtor[key] = 0;
+
+ __gthread_mutex_unlock (&tsd_lock);
+ return 0;
+}
+
+/* Retrieve the thread-specific value for KEY. If it has never been
+ set in this thread, or KEY is invalid, returns NULL.
+
+ It does not matter if this function races with key_create or
+ key_delete; the worst that can happen is you get a value other than
+ the one that a serialized implementation would have provided. */
+
+void *
+__gthread_getspecific (__gthread_key_t key)
+{
+ struct tsd_data *data;
+
+ if (key >= MAX_KEYS)
+ return 0;
+
+ data = __gthread_get_tsd_data (taskTcb (taskIdSelf ()));
+
+ if (!data)
+ return 0;
+
+ if (data->generation[key] != tsd_keys.generation[key])
+ return 0;
+
+ return data->values[key];
+}
+
+/* Set the thread-specific value for KEY. If KEY is invalid, or
+ memory allocation fails, returns -1, otherwise 0.
+
+ The generation count protects this function against races with
+ key_create/key_delete; the worst thing that can happen is that a
+ value is successfully stored into a dead generation (and then
+ immediately becomes invalid). However, we do have to make sure
+ to read tsd_keys.generation[key] atomically. */
+
+int
+__gthread_setspecific (__gthread_key_t key, void *value)
+{
+ struct tsd_data *data;
+ WIND_TCB *tcb;
+ unsigned int generation;
+
+ if (key >= MAX_KEYS)
+ return EINVAL;
+
+ tcb = taskTcb (taskIdSelf ());
+ data = __gthread_get_tsd_data (tcb);
+ if (!data)
+ {
+ data = malloc (sizeof (struct tsd_data));
+ if (!data)
+ return ENOMEM;
+
+ memset (data, 0, sizeof (struct tsd_data));
+ __gthread_set_tsd_data (tcb, data);
+ }
+
+ generation = tsd_keys.generation[key];
+
+ if (generation & 1)
+ return EINVAL;
+
+ data->generation[key] = generation;
+ data->values[key] = value;
+
+ return 0;
+}
diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h
new file mode 100644
index 00000000000..75aae79d68e
--- /dev/null
+++ b/gcc/config/vxworks.h
@@ -0,0 +1,65 @@
+/* Common VxWorks target definitions for GNU compiler.
+ Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Contributed by Wind River Systems.
+
+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. */
+
+/* Specify what to link with. */
+/* VxWorks does all the library stuff itself. */
+#undef LIB_SPEC
+#define LIB_SPEC ""
+
+#undef LINK_SPEC
+#define LINK_SPEC "-r"
+
+/* VxWorks provides the functionality of crt0.o and friends itself. */
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC ""
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC ""
+
+/* VxWorks cannot have dots in constructor labels, because it uses a
+ mutant variation of collect2 that generates C code instead of
+ assembly. Thus each constructor label must be a legitimate C
+ symbol. FIXME: Have VxWorks use real collect2 instead. */
+
+#undef NO_DOLLAR_IN_LABEL
+#define NO_DOT_IN_LABEL
+
+/* enable #pragma pack(n) */
+#define HANDLE_SYSV_PRAGMA
+
+/* No underscore is prepended to any C symbol name. */
+#undef USER_LABEL_PREFIX
+#define USER_LABEL_PREFIX ""
+
+/* VxWorks uses wchar_t == unsigned short (UCS2) on all architectures. */
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "short unsigned int"
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 16
+
+/* Dwarf2 unwind info is not supported. */
+#define DWARF2_UNWIND_INFO 0
+/* Weak symbols and link-once sections are not enabled by default. */
+#define DEFAULT_USE_WEAK 0
+
+/* Only supported debug format is Dwarf2. */
+#undef DBX_DEBUGGING_INFO
+#undef DWARF_DEBUGGING_INFO
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index babb5b06a51..4ad8c80475b 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "machmode.h"
diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
index c495ef11af2..d51b6795a34 100644
--- a/gcc/config/xtensa/xtensa.h
+++ b/gcc/config/xtensa/xtensa.h
@@ -1281,11 +1281,6 @@ typedef struct xtensa_args {
indexing purposes) so give the MEM rtx a words's mode. */
#define FUNCTION_MODE SImode
-/* A C expression that evaluates to true if it is ok to perform a
- sibling call to DECL. */
-/* TODO: fix this up to allow at least some sibcalls */
-#define FUNCTION_OK_FOR_SIBCALL(DECL) 0
-
/* Xtensa constant costs. */
#define CONST_COSTS(X, CODE, OUTER_CODE) \
case CONST_INT: \
@@ -1634,15 +1629,6 @@ typedef struct xtensa_args {
goto JUMPTO; \
} while (0)
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
- do { \
- (OUTPUT) = (char *) alloca (strlen (NAME) + 10); \
- sprintf ((OUTPUT), "%s.%u", (NAME), (LABELNO)); \
- } while (0)
-
/* How to start an assembler comment. */
#define ASM_COMMENT_START "#"
diff --git a/gcc/configure b/gcc/configure
index 7c20fad4b86..30cbfaeef7b 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -62,10 +62,17 @@ ac_help="$ac_help
ac_help="$ac_help
--disable-shared don't provide a shared libgcc"
ac_help="$ac_help
+ --with-sysroot[=DIR] Search for usr/lib, usr/include, et al, within DIR."
+ac_help="$ac_help
--with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib"
ac_help="$ac_help
--enable-initfini-array use .init_array/.fini_array sections"
ac_help="$ac_help
+ --enable-sjlj-exceptions
+ arrange to use setjmp/longjmp exception handling"
+ac_help="$ac_help
+ --enable-libunwind-exceptions force use libunwind for exceptions"
+ac_help="$ac_help
--enable-nls use Native Language Support (default)"
ac_help="$ac_help
--with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib"
@@ -91,11 +98,6 @@ ac_help="$ac_help
enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer"
ac_help="$ac_help
- --enable-sjlj-exceptions
- arrange to use setjmp/longjmp exception handling"
-ac_help="$ac_help
- --enable-libunwind-exceptions force use libunwind for exceptions"
-ac_help="$ac_help
--enable-version-specific-runtime-libs
specify that runtime libraries should be
installed in a compiler-specific directory"
@@ -627,7 +629,7 @@ copy=cp
# - 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:631: checking LIBRARY_PATH variable" >&5
+echo "configure:633: checking LIBRARY_PATH variable" >&5
case ${LIBRARY_PATH} in
[:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
library_path_setting="contains current directory"
@@ -652,7 +654,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:656: checking GCC_EXEC_PREFIX variable" >&5
+echo "configure:658: checking GCC_EXEC_PREFIX variable" >&5
case ${GCC_EXEC_PREFIX} in
[:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
gcc_exec_prefix_setting="contains current directory"
@@ -839,7 +841,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:843: checking host system type" >&5
+echo "configure:845: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -860,7 +862,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:864: checking target system type" >&5
+echo "configure:866: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -878,7 +880,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:882: checking build system type" >&5
+echo "configure:884: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -926,7 +928,7 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
# 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:930: checking for $ac_word" >&5
+echo "configure:932: 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
@@ -956,7 +958,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:960: checking for $ac_word" >&5
+echo "configure:962: 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
@@ -1007,7 +1009,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:1011: checking for $ac_word" >&5
+echo "configure:1013: 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
@@ -1039,7 +1041,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1043: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1045: 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.
@@ -1050,12 +1052,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 1054 "configure"
+#line 1056 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1061: \"$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
@@ -1081,12 +1083,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:1085: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1087: 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:1090: checking whether we are using GNU C" >&5
+echo "configure:1092: 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
@@ -1095,7 +1097,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1099: \"$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:1101: \"$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
@@ -1114,7 +1116,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:1118: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1120: 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
@@ -1147,10 +1149,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:1151: checking whether $CC and cc understand -c and -o together" >&5
+echo "configure:1153: 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:1154: checking whether cc understands -c and -o together" >&5
+echo "configure:1156: 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]/_/'`"
@@ -1162,16 +1164,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:1166: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
- test -f conftest.o && { (eval echo configure:1167: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+if { (eval echo configure:1168: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
+ test -f conftest.o && { (eval echo configure:1169: \"$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:1172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1174: \"$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:1174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
- test -f conftest.o && { (eval echo configure:1175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+ if { (eval echo configure:1176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
+ test -f conftest.o && { (eval echo configure:1177: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
then
# cc works too.
:
@@ -1217,7 +1219,7 @@ 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:1221: checking for $ac_word" >&5
+echo "configure:1223: 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
@@ -1249,7 +1251,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:1253: checking for $ac_word" >&5
+echo "configure:1255: 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
@@ -1282,7 +1284,7 @@ fi
fi
echo $ac_n "checking for compiler driver that understands Ada""... $ac_c" 1>&6
-echo "configure:1286: checking for compiler driver that understands Ada" >&5
+echo "configure:1288: checking for compiler driver that understands Ada" >&5
if eval "test \"`echo '$''{'gcc_cv_prog_adac'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1327,21 +1329,21 @@ fi
echo $ac_n "checking whether ${CC-cc} accepts -Wno-long-long""... $ac_c" 1>&6
-echo "configure:1331: checking whether ${CC-cc} accepts -Wno-long-long" >&5
+echo "configure:1333: 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 <<EOF
-#line 1338 "configure"
+#line 1340 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1345: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_prog_cc_no_long_long=yes
else
@@ -1358,7 +1360,7 @@ echo "$ac_t""$ac_cv_prog_cc_no_long_long" 1>&6
if test x$have_gnat != xno ; then
echo $ac_n "checking whether ${ADAC} accepts -Wno-long-long""... $ac_c" 1>&6
-echo "configure:1362: checking whether ${ADAC} accepts -Wno-long-long" >&5
+echo "configure:1364: 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
@@ -1386,7 +1388,7 @@ fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1390: checking how to run the C preprocessor" >&5
+echo "configure:1392: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1401,13 +1403,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1405 "configure"
+#line 1407 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1411: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1413: \"$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
:
@@ -1418,13 +1420,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1422 "configure"
+#line 1424 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1430: \"$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
:
@@ -1435,13 +1437,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1439 "configure"
+#line 1441 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1445: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1447: \"$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
:
@@ -1466,21 +1468,21 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1470: checking for inline" >&5
+echo "configure:1472: 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 <<EOF
-#line 1477 "configure"
+#line 1479 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1486: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -1506,19 +1508,19 @@ EOF
esac
echo $ac_n "checking for volatile""... $ac_c" 1>&6
-echo "configure:1510: checking for volatile" >&5
+echo "configure:1512: checking for volatile" >&5
if eval "test \"`echo '$''{'gcc_cv_c_volatile'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1515 "configure"
+#line 1517 "configure"
#include "confdefs.h"
int main() {
volatile int foo;
; return 0; }
EOF
-if { (eval echo configure:1522: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_c_volatile=yes
else
@@ -1540,7 +1542,7 @@ fi
echo $ac_n "checking for long double""... $ac_c" 1>&6
-echo "configure:1544: checking for long double" >&5
+echo "configure:1546: checking for long double" >&5
if eval "test \"`echo '$''{'gcc_cv_c_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1548,7 +1550,7 @@ else
gcc_cv_c_long_double=yes
else
cat > conftest.$ac_ext <<EOF
-#line 1552 "configure"
+#line 1554 "configure"
#include "confdefs.h"
int main() {
@@ -1558,7 +1560,7 @@ long double foo = 0.0;
switch (0) case 0: case (sizeof(long double) >= sizeof(double)):;
; return 0; }
EOF
-if { (eval echo configure:1562: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_c_long_double=yes
else
@@ -1580,19 +1582,19 @@ EOF
fi
echo $ac_n "checking for long long int""... $ac_c" 1>&6
-echo "configure:1584: checking for long long int" >&5
+echo "configure:1586: 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 <<EOF
-#line 1589 "configure"
+#line 1591 "configure"
#include "confdefs.h"
int main() {
long long int i;
; return 0; }
EOF
-if { (eval echo configure:1596: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1598: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_long_long=yes
else
@@ -1612,19 +1614,19 @@ EOF
fi
echo $ac_n "checking for __int64""... $ac_c" 1>&6
-echo "configure:1616: checking for __int64" >&5
+echo "configure:1618: 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 <<EOF
-#line 1621 "configure"
+#line 1623 "configure"
#include "confdefs.h"
int main() {
__int64 i;
; return 0; }
EOF
-if { (eval echo configure:1628: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1630: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c___int64=yes
else
@@ -1645,19 +1647,19 @@ EOF
fi
echo $ac_n "checking for built-in _Bool""... $ac_c" 1>&6
-echo "configure:1649: checking for built-in _Bool" >&5
+echo "configure:1651: 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 <<EOF
-#line 1654 "configure"
+#line 1656 "configure"
#include "confdefs.h"
int main() {
_Bool foo;
; return 0; }
EOF
-if { (eval echo configure:1661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1663: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_c__bool=yes
else
@@ -1681,13 +1683,13 @@ fi
# sizeof(char) is 1 by definition.
echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:1685: checking size of short" >&5
+echo "configure:1687: 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 ; do # List sizes in rough order of prevalence.
+ for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 1691 "configure"
+#line 1693 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -1697,7 +1699,7 @@ int main() {
switch (0) case 0: case (sizeof (short) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:1701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_short=$ac_size
else
@@ -1720,13 +1722,13 @@ EOF
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:1724: checking size of int" >&5
+echo "configure:1726: 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 ; do # List sizes in rough order of prevalence.
+ for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 1730 "configure"
+#line 1732 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -1736,7 +1738,7 @@ int main() {
switch (0) case 0: case (sizeof (int) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:1740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1742: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_int=$ac_size
else
@@ -1759,13 +1761,13 @@ EOF
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:1763: checking size of long" >&5
+echo "configure:1765: 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 ; do # List sizes in rough order of prevalence.
+ for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 1769 "configure"
+#line 1771 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -1775,7 +1777,7 @@ int main() {
switch (0) case 0: case (sizeof (long) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:1779: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1781: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_long=$ac_size
else
@@ -1799,13 +1801,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:1803: checking size of long long" >&5
+echo "configure:1805: 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 ; do # List sizes in rough order of prevalence.
+ for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 1809 "configure"
+#line 1811 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -1815,7 +1817,7 @@ int main() {
switch (0) case 0: case (sizeof (long long) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:1819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1821: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_long_long=$ac_size
else
@@ -1840,13 +1842,13 @@ EOF
fi
if test $ac_cv_c___int64 = yes; then
echo $ac_n "checking size of __int64""... $ac_c" 1>&6
-echo "configure:1844: checking size of __int64" >&5
+echo "configure:1846: 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 ; do # List sizes in rough order of prevalence.
+ for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 1850 "configure"
+#line 1852 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -1856,7 +1858,7 @@ int main() {
switch (0) case 0: case (sizeof (__int64) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:1860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1862: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof___int64=$ac_size
else
@@ -1881,12 +1883,12 @@ EOF
fi
echo $ac_n "checking execution character set""... $ac_c" 1>&6
-echo "configure:1885: checking execution character set" >&5
+echo "configure:1887: checking execution character set" >&5
if eval "test \"`echo '$''{'ac_cv_c_charset'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1890 "configure"
+#line 1892 "configure"
#include "confdefs.h"
#if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \
&& 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21
@@ -1902,7 +1904,7 @@ rm -f conftest*
if test x${ac_cv_c_charset+set} != xset; then
cat > conftest.$ac_ext <<EOF
-#line 1906 "configure"
+#line 1908 "configure"
#include "confdefs.h"
#if '\n' == 0x15 && ' ' == 0x40 && '0' == 0xF0 \
&& 'A' == 0xC1 && 'a' == 0x81 && '!' == 0x5A
@@ -2036,17 +2038,17 @@ if test x$ac_checking_valgrind != x ; then
# GCC relies on making annotations so we must have both.
ac_safe=`echo "valgrind.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for valgrind.h""... $ac_c" 1>&6
-echo "configure:2040: checking for valgrind.h" >&5
+echo "configure:2042: 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
-#line 2045 "configure"
+#line 2047 "configure"
#include "confdefs.h"
#include <valgrind.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2050: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2052: \"$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*
@@ -2071,7 +2073,7 @@ fi
# 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:2075: checking for $ac_word" >&5
+echo "configure:2077: 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
@@ -2252,6 +2254,30 @@ fi
+# Check whether --with-sysroot or --without-sysroot was given.
+if test "${with_sysroot+set}" = set; then
+ withval="$with_sysroot"
+
+ case ${with_sysroot} in
+ yes) TARGET_SYSTEM_ROOT='${gcc_tooldir}/sys-root' ;;
+ *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
+ esac
+
+ TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
+ CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR)'
+
+else
+
+ TARGET_SYSTEM_ROOT=
+ TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=0'
+ CROSS_SYSTEM_HEADER_DIR='$(gcc_tooldir)/sys-include'
+
+fi
+
+
+
+
+
# Stage specific cflags for build.
stage1_cflags=
case $build in
@@ -2274,7 +2300,7 @@ esac
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:2278: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:2304: 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
@@ -2302,7 +2328,7 @@ fi
echo $ac_n "checking whether a default assembler was specified""... $ac_c" 1>&6
-echo "configure:2306: checking whether a default assembler was specified" >&5
+echo "configure:2332: 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
@@ -2314,7 +2340,7 @@ else
fi
echo $ac_n "checking whether a default linker was specified""... $ac_c" 1>&6
-echo "configure:2318: checking whether a default linker was specified" >&5
+echo "configure:2344: 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
@@ -2326,12 +2352,12 @@ else
fi
echo $ac_n "checking for GNU C library""... $ac_c" 1>&6
-echo "configure:2330: checking for GNU C library" >&5
+echo "configure:2356: 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 <<EOF
-#line 2335 "configure"
+#line 2361 "configure"
#include "confdefs.h"
#include <features.h>
int main() {
@@ -2341,7 +2367,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:2345: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2371: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_glibc=yes
else
@@ -2362,12 +2388,12 @@ EOF
fi
# Find some useful tools
-for ac_prog in gawk mawk nawk awk
+for ac_prog in mawk gawk 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2371: checking for $ac_word" >&5
+echo "configure:2397: 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
@@ -2397,7 +2423,7 @@ test -n "$AWK" && break
done
echo $ac_n "checking whether ln works""... $ac_c" 1>&6
-echo "configure:2401: checking whether ln works" >&5
+echo "configure:2427: 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
@@ -2429,7 +2455,7 @@ else
fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:2433: checking whether ln -s works" >&5
+echo "configure:2459: 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
@@ -2463,7 +2489,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:2467: checking for $ac_word" >&5
+echo "configure:2493: 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
@@ -2501,7 +2527,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:2505: checking for a BSD compatible install" >&5
+echo "configure:2531: 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
@@ -2552,12 +2578,12 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2556: checking for ANSI C header files" >&5
+echo "configure:2582: 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 <<EOF
-#line 2561 "configure"
+#line 2587 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2565,7 +2591,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2569: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2595: \"$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*
@@ -2582,7 +2608,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
-#line 2586 "configure"
+#line 2612 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2600,7 +2626,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
-#line 2604 "configure"
+#line 2630 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2621,7 +2647,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2625 "configure"
+#line 2651 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2632,7 +2658,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2656,12 +2682,12 @@ EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2660: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:2686: 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 <<EOF
-#line 2665 "configure"
+#line 2691 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -2670,7 +2696,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:2674: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -2691,19 +2717,19 @@ EOF
fi
echo $ac_n "checking for working stdbool.h""... $ac_c" 1>&6
-echo "configure:2695: checking for working stdbool.h" >&5
+echo "configure:2721: 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 <<EOF
-#line 2700 "configure"
+#line 2726 "configure"
#include "confdefs.h"
#include <stdbool.h>
int main() {
bool foo = false;
; return 0; }
EOF
-if { (eval echo configure:2707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_stdbool_h=yes
else
@@ -2724,12 +2750,12 @@ EOF
fi
echo $ac_n "checking whether string.h and strings.h may both be included""... $ac_c" 1>&6
-echo "configure:2728: checking whether string.h and strings.h may both be included" >&5
+echo "configure:2754: 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 <<EOF
-#line 2733 "configure"
+#line 2759 "configure"
#include "confdefs.h"
#include <string.h>
#include <strings.h>
@@ -2737,7 +2763,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:2741: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_header_string=yes
else
@@ -2758,12 +2784,12 @@ EOF
fi
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:2762: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:2788: 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 <<EOF
-#line 2767 "configure"
+#line 2793 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -2779,7 +2805,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:2783: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@@ -2806,17 +2832,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:2810: checking for $ac_hdr" >&5
+echo "configure:2836: 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
-#line 2815 "configure"
+#line 2841 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2846: \"$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*
@@ -2846,17 +2872,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:2850: checking for thread.h" >&5
+echo "configure:2876: 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
-#line 2855 "configure"
+#line 2881 "configure"
#include "confdefs.h"
#include <thread.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2860: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2886: \"$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*
@@ -2880,17 +2906,17 @@ fi
ac_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for pthread.h""... $ac_c" 1>&6
-echo "configure:2884: checking for pthread.h" >&5
+echo "configure:2910: 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
-#line 2889 "configure"
+#line 2915 "configure"
#include "confdefs.h"
#include <pthread.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2920: \"$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*
@@ -2915,12 +2941,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:2919: checking for CHAR_BIT" >&5
+echo "configure:2945: 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 <<EOF
-#line 2924 "configure"
+#line 2950 "configure"
#include "confdefs.h"
#ifdef HAVE_LIMITS_H
#include <limits.h>
@@ -2945,7 +2971,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:2949: checking number of bits in a byte" >&5
+echo "configure:2975: 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
@@ -2953,7 +2979,7 @@ else
gcc_cv_c_nbby=
while test $i -lt 65; do
cat > conftest.$ac_ext <<EOF
-#line 2957 "configure"
+#line 2983 "configure"
#include "confdefs.h"
int main() {
@@ -2963,7 +2989,7 @@ switch(0) {
; }
; return 0; }
EOF
-if { (eval echo configure:2967: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_c_nbby=$i; break
else
@@ -2987,81 +3013,144 @@ EOF
fi
fi
-echo $ac_n "checking byte ordering""... $ac_c" 1>&6
-echo "configure:2992: checking byte ordering" >&5
-if eval "test \"`echo '$''{'ac_cv_c_compile_endian'+set}'`\" = set"; then
+echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
+echo "configure:3018: 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_compile_endian=unknown
-
-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_cv_c_bigendian=unknown
+# See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF
-#line 3006 "configure"
+#line 3025 "configure"
#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/param.h>
+int main() {
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
+#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
+ bogus endian macros
#endif
-/* This structure must have no internal padding. */
- struct {
- char prefix[sizeof "\nendian:" - 1];
- short word;
- char postfix[2];
- } tester = {
- "\nendian:",
-#if SIZEOF_SHORT == 4
- ('A' << (CHAR_BIT * 3)) | ('B' << (CHAR_BIT * 2)) |
+; return 0; }
+EOF
+if { (eval echo configure:3036: \"$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 <<EOF
+#line 3040 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/param.h>
+int main() {
+
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
#endif
- ('A' << CHAR_BIT) | 'B',
- 'X', '\n'
-};
+; return 0; }
EOF
-if { (eval echo configure:3026: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- od -c conftest.o |
- sed 's/^[0-7]*[ ]*/ /
- s/\*/./g
- s/ \\n/*/g
- s/ [0-9][0-9][0-9]/./g
- s/ \\[^ ]/./g' |
- tr -d '
- ' | tr -s '*' '
-' | fold | sed '$a\
-' > conftest.dmp
- if grep 'endian:AB' conftest.dmp >/dev/null 2>&1; then
- ac_cv_c_compile_endian=big-endian
- elif grep 'endian:BA' conftest.dmp >/dev/null 2>&1; then
- ac_cv_c_compile_endian=little-endian
- fi
+if { (eval echo configure:3051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ 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
+fi
+rm -f conftest*
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+if test $ac_cv_c_bigendian = unknown; then
+if test "$cross_compiling" = yes; then
+ echo $ac_n "cross-compiling... " 2>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3071 "configure"
+#include "confdefs.h"
+main () {
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long l;
+ char c[sizeof (long)];
+ } u;
+ u.l = 1;
+ exit (u.c[sizeof (long) - 1] == 1);
+}
+EOF
+if { (eval echo configure:3084: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_c_bigendian=yes
+fi
+rm -fr conftest*
fi
-rm -rf 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
+fi
+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:3102: checking to probe for byte ordering" >&5
+cat >conftest.c <<EOF
+short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+void _ascii() { char* s = (char*) ascii_mm; s = (char*) ascii_ii; }
+short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+void _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; }
+int main() { _ascii (); _ebcdic (); return 0; }
+EOF
+ if test -f conftest.c ; then
+ if ${CC-cc} ${CFLAGS} conftest.c -o conftest.o && test -f conftest.o ; then
+ if test `grep -l BIGenDianSyS conftest.o` ; then
+ echo $ac_n ' big endian probe OK, ' 1>&6
+ ac_cv_c_bigendian=yes
+ fi
+ if test `grep -l LiTTleEnDian conftest.o` ; then
+ echo $ac_n ' little endian probe OK, ' 1>&6
+ if test $ac_cv_c_bigendian = yes ; then
+ ac_cv_c_bigendian=unknown;
+ else
+ ac_cv_c_bigendian=no
+ fi
+ fi
+ echo $ac_n 'guessing bigendian ... ' >&6
+ fi
+ fi
+echo "$ac_t""$ac_cv_c_bigendian" 1>&6
fi
+if test $ac_cv_c_bigendian = yes; then
+ cat >> confdefs.h <<\EOF
+#define WORDS_BIGENDIAN 1
+EOF
-echo "$ac_t""$ac_cv_c_compile_endian" 1>&6
-if test $ac_cv_c_compile_endian = unknown; then
- { echo "configure: error: *** unable to determine endianness" 1>&2; exit 1; }
-elif test $ac_cv_c_compile_endian = big-endian; then
cat >> confdefs.h <<\EOF
#define HOST_WORDS_BIG_ENDIAN 1
EOF
+ BYTEORDER=4321
+else
+ BYTEORDER=1234
+fi
+cat >> confdefs.h <<EOF
+#define BYTEORDER $BYTEORDER
+EOF
+
+if test $ac_cv_c_bigendian = unknown; then
+ { echo "configure: error: unknown endianess - sorry" 1>&2; exit 1; }
fi
echo $ac_n "checking floating point format""... $ac_c" 1>&6
-echo "configure:3065: checking floating point format" >&5
+echo "configure:3154: checking floating point format" >&5
if eval "test \"`echo '$''{'ac_cv_c_float_format'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3074,7 +3163,7 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 3078 "configure"
+#line 3167 "configure"
#include "confdefs.h"
/* This will not work unless sizeof(double) == 8. */
extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
@@ -3096,7 +3185,7 @@ struct possibility table [] =
C(-5.22995989424860458374e+10) /* IBMHEXFP - s/390 format, EBCDIC */
};
EOF
-if { (eval echo configure:3100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
od -c conftest.o |
sed 's/^[0-7]*[ ]*/ /
s/\*/./g
@@ -3148,12 +3237,12 @@ format=
fbigend=
case $ac_cv_c_float_format in
'IEEE (big-endian)' )
- if test $ac_cv_c_compile_endian = little-endian; then
+ if test $ac_cv_c_bigendian = no; then
fbigend=1
fi
;;
'IEEE (little-endian)' )
- if test $ac_cv_c_compile_endian = big-endian; then
+ if test $ac_cv_c_bigendian = yes; then
fbigend=0
fi
;;
@@ -3185,7 +3274,7 @@ fi
# 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:3189: checking for $ac_word" >&5
+echo "configure:3278: 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
@@ -3224,7 +3313,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:3228: checking for $ac_word" >&5
+echo "configure:3317: 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
@@ -3253,13 +3342,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:3257: checking for modern makeinfo" >&5
+echo "configure:3346: 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:3263: version of makeinfo is $ac_prog_version" >&5
+ echo "configure:3352: version of makeinfo is $ac_prog_version" >&5
case $ac_prog_version in
'') gcc_cv_prog_makeinfo_modern=no;;
4.[1-9]*)
@@ -3287,7 +3376,7 @@ fi
# Is pod2man recent enough to regenerate manpages?
echo $ac_n "checking for recent Pod::Man""... $ac_c" 1>&6
-echo "configure:3291: checking for recent Pod::Man" >&5
+echo "configure:3380: 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
@@ -3303,7 +3392,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:3307: checking for $ac_word" >&5
+echo "configure:3396: 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
@@ -3340,7 +3429,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:3344: checking for $ac_word" >&5
+echo "configure:3433: 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
@@ -3372,7 +3461,7 @@ fi
# These libraries may be used by collect2.
# We may need a special search path to get them linked.
echo $ac_n "checking for collect2 libraries""... $ac_c" 1>&6
-echo "configure:3376: checking for collect2 libraries" >&5
+echo "configure:3465: 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
@@ -3383,7 +3472,7 @@ for libs in '' -lld -lmld \
do
LIBS="$libs"
cat > conftest.$ac_ext <<EOF
-#line 3387 "configure"
+#line 3476 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3394,7 +3483,7 @@ int main() {
ldopen()
; return 0; }
EOF
-if { (eval echo configure:3398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3487: \"$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
@@ -3420,14 +3509,14 @@ save_LIBS="$LIBS"
LIBS=
echo $ac_n "checking for library containing exc_resume""... $ac_c" 1>&6
-echo "configure:3424: checking for library containing exc_resume" >&5
+echo "configure:3513: 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 <<EOF
-#line 3431 "configure"
+#line 3520 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3438,7 +3527,7 @@ int main() {
exc_resume()
; return 0; }
EOF
-if { (eval echo configure:3442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3531: \"$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
@@ -3449,7 +3538,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 <<EOF
-#line 3453 "configure"
+#line 3542 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3460,7 +3549,7 @@ int main() {
exc_resume()
; return 0; }
EOF
-if { (eval echo configure:3464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3553: \"$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
@@ -3489,12 +3578,12 @@ LIBS="$save_LIBS"
echo $ac_n "checking for preprocessor stringizing operator""... $ac_c" 1>&6
-echo "configure:3493: checking for preprocessor stringizing operator" >&5
+echo "configure:3582: checking for preprocessor stringizing operator" >&5
if eval "test \"`echo '$''{'ac_cv_c_stringize'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3498 "configure"
+#line 3587 "configure"
#include "confdefs.h"
#define x(y) #y
@@ -3527,12 +3616,12 @@ echo "$ac_t""${ac_cv_c_stringize}" 1>&6
# Use <inttypes.h> only if it exists,
# doesn't clash with <sys/types.h>, and declares intmax_t.
echo $ac_n "checking for inttypes.h""... $ac_c" 1>&6
-echo "configure:3531: checking for inttypes.h" >&5
+echo "configure:3620: 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 <<EOF
-#line 3536 "configure"
+#line 3625 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <inttypes.h>
@@ -3540,7 +3629,7 @@ int main() {
intmax_t i = -1;
; return 0; }
EOF
-if { (eval echo configure:3544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_header_inttypes_h=yes
else
@@ -3567,12 +3656,12 @@ for ac_func in times clock dup2 kill getrlimit setrlimit atoll atoq \
scandir alphasort
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3571: checking for $ac_func" >&5
+echo "configure:3660: 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 <<EOF
-#line 3576 "configure"
+#line 3665 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3595,7 +3684,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3688: \"$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
@@ -3621,12 +3710,12 @@ done
echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:3625: checking for ssize_t" >&5
+echo "configure:3714: 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 <<EOF
-#line 3630 "configure"
+#line 3719 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -3657,12 +3746,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:3661: checking for uid_t in sys/types.h" >&5
+echo "configure:3750: 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
-#line 3666 "configure"
+#line 3755 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -3691,7 +3780,7 @@ EOF
fi
echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:3695: checking type of array argument to getgroups" >&5
+echo "configure:3784: 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
@@ -3699,7 +3788,7 @@ else
ac_cv_type_getgroups=cross
else
cat > conftest.$ac_ext <<EOF
-#line 3703 "configure"
+#line 3792 "configure"
#include "confdefs.h"
/* Thanks to Mike Rendell for this test. */
@@ -3724,7 +3813,7 @@ main()
}
EOF
-if { (eval echo configure:3728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3817: \"$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
@@ -3738,7 +3827,7 @@ fi
if test $ac_cv_type_getgroups = cross; then
cat > conftest.$ac_ext <<EOF
-#line 3742 "configure"
+#line 3831 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -3779,7 +3868,7 @@ fi
echo $ac_n "checking whether the printf functions support %p""... $ac_c" 1>&6
-echo "configure:3783: checking whether the printf functions support %p" >&5
+echo "configure:3872: 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
@@ -3787,7 +3876,7 @@ else
gcc_cv_func_printf_ptr=no
else
cat > conftest.$ac_ext <<EOF
-#line 3791 "configure"
+#line 3880 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3800,7 +3889,7 @@ int main()
return (p != q);
}
EOF
-if { (eval echo configure:3804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3893: \"$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
@@ -3838,12 +3927,12 @@ case "${host}" in
;;
esac
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:3842: checking for pid_t" >&5
+echo "configure:3931: 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 <<EOF
-#line 3847 "configure"
+#line 3936 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -3872,17 +3961,17 @@ fi
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:3876: checking for vfork.h" >&5
+echo "configure:3965: 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
-#line 3881 "configure"
+#line 3970 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3886: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3975: \"$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*
@@ -3907,18 +3996,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:3911: checking for working vfork" >&5
+echo "configure:4000: 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:3917: checking for vfork" >&5
+echo "configure:4006: 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 <<EOF
-#line 3922 "configure"
+#line 4011 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -3941,7 +4030,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:3945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4034: \"$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
@@ -3963,7 +4052,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 3967 "configure"
+#line 4056 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -4058,7 +4147,7 @@ main() {
}
}
EOF
-if { (eval echo configure:4062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4151: \"$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
@@ -4083,12 +4172,12 @@ fi
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4087: checking for $ac_func" >&5
+echo "configure:4176: 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 <<EOF
-#line 4092 "configure"
+#line 4181 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4111,7 +4200,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4204: \"$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
@@ -4382,7 +4471,7 @@ main ()
EOF
echo $ac_n "checking for working mmap from /dev/zero""... $ac_c" 1>&6
-echo "configure:4386: checking for working mmap from /dev/zero" >&5
+echo "configure:4475: checking for working mmap from /dev/zero" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_dev_zero'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4397,11 +4486,11 @@ else
esac
else
cat > conftest.$ac_ext <<EOF
-#line 4401 "configure"
+#line 4490 "configure"
#include "confdefs.h"
#include "ct-mmap.inc"
EOF
-if { (eval echo configure:4405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_dev_zero=yes
else
@@ -4428,7 +4517,7 @@ EOF
fi
echo $ac_n "checking for working mmap with MAP_ANON(YMOUS)""... $ac_c" 1>&6
-echo "configure:4432: checking for working mmap with MAP_ANON(YMOUS)" >&5
+echo "configure:4521: checking for working mmap with MAP_ANON(YMOUS)" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_anon'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4441,12 +4530,12 @@ else
esac
else
cat > conftest.$ac_ext <<EOF
-#line 4445 "configure"
+#line 4534 "configure"
#include "confdefs.h"
#define USE_MAP_ANON
#include "ct-mmap.inc"
EOF
-if { (eval echo configure:4450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_anon=yes
else
@@ -4474,7 +4563,7 @@ fi
rm -f ct-mmap.inc
echo $ac_n "checking for working mmap of a file""... $ac_c" 1>&6
-echo "configure:4478: checking for working mmap of a file" >&5
+echo "configure:4567: checking for working mmap of a file" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_file'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4492,7 +4581,7 @@ if test "$cross_compiling" = yes; then
esac
else
cat > conftest.$ac_ext <<EOF
-#line 4496 "configure"
+#line 4585 "configure"
#include "confdefs.h"
/* Test by Zack Weinberg. Modified from MMAP_ANYWHERE test by
@@ -4529,7 +4618,7 @@ int main()
exit(0);
}
EOF
-if { (eval echo configure:4533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_file=yes
else
@@ -4568,7 +4657,7 @@ fi
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:4572: checking for iconv" >&5
+echo "configure:4661: checking for iconv" >&5
if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4576,7 +4665,7 @@ else
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
cat > conftest.$ac_ext <<EOF
-#line 4580 "configure"
+#line 4669 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -4586,7 +4675,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:4590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_func_iconv=yes
else
@@ -4598,7 +4687,7 @@ rm -f conftest*
am_save_LIBS="$LIBS"
LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
cat > conftest.$ac_ext <<EOF
-#line 4602 "configure"
+#line 4691 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -4608,7 +4697,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:4612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4701: \"$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
@@ -4629,13 +4718,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
EOF
echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:4633: checking for iconv declaration" >&5
+echo "configure:4722: 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 <<EOF
-#line 4639 "configure"
+#line 4728 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -4654,7 +4743,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:4658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_proto_iconv_arg1=""
else
@@ -4692,12 +4781,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:4696: checking whether $ac_func is declared" >&5
+echo "configure:4785: 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 <<EOF
-#line 4701 "configure"
+#line 4790 "configure"
#include "confdefs.h"
#undef $ac_tr_decl
#define $ac_tr_decl 1
@@ -4711,7 +4800,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:4715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -4813,12 +4902,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:4817: checking whether $ac_func is declared" >&5
+echo "configure:4906: 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 <<EOF
-#line 4822 "configure"
+#line 4911 "configure"
#include "confdefs.h"
#undef $ac_tr_decl
#define $ac_tr_decl 1
@@ -4836,7 +4925,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:4840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4929: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -4878,12 +4967,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:4882: checking whether $ac_func is declared" >&5
+echo "configure:4971: 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 <<EOF
-#line 4887 "configure"
+#line 4976 "configure"
#include "confdefs.h"
#undef $ac_tr_decl
#define $ac_tr_decl 1
@@ -4901,7 +4990,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:4905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -4935,13 +5024,13 @@ fi
# More time-related stuff.
echo $ac_n "checking for struct tms""... $ac_c" 1>&6
-echo "configure:4939: checking for struct tms" >&5
+echo "configure:5028: 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 <<EOF
-#line 4945 "configure"
+#line 5034 "configure"
#include "confdefs.h"
#include "ansidecl.h"
@@ -4954,7 +5043,7 @@ int main() {
struct tms tms;
; return 0; }
EOF
-if { (eval echo configure:4958: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5047: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tms=yes
else
@@ -4977,13 +5066,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:4981: checking for clock_t" >&5
+echo "configure:5070: 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 <<EOF
-#line 4987 "configure"
+#line 5076 "configure"
#include "confdefs.h"
#include "ansidecl.h"
@@ -4993,7 +5082,7 @@ int main() {
clock_t x;
; return 0; }
EOF
-if { (eval echo configure:4997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_type_clock_t=yes
else
@@ -5019,7 +5108,7 @@ if test "${enable_initfini_array+set}" = set; then
gcc_cv_initfinit_array=$enableval
else
echo $ac_n "checking for .preinit_array/.init_array/.fini_array support""... $ac_c" 1>&6
-echo "configure:5023: checking for .preinit_array/.init_array/.fini_array support" >&5
+echo "configure:5112: checking for .preinit_array/.init_array/.fini_array support" >&5
if eval "test \"`echo '$''{'gcc_cv_initfinit_array'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5029,7 +5118,7 @@ int main (void) { return x; }
int foo (void) { x = 0; }
int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
EOF
- if { ac_try='${CC-cc} -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD'; { (eval echo configure:5033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='${CC-cc} -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD'; { (eval echo configure:5122: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
if ./conftest; then
gcc_cv_initfinit_array=yes
@@ -5058,12 +5147,12 @@ CFLAGS="$saved_CFLAGS"
# mkdir takes a single argument on some systems.
echo $ac_n "checking if mkdir takes one argument""... $ac_c" 1>&6
-echo "configure:5062: checking if mkdir takes one argument" >&5
+echo "configure:5151: 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 <<EOF
-#line 5067 "configure"
+#line 5156 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -5080,7 +5169,7 @@ int main() {
mkdir ("foo", 0);
; return 0; }
EOF
-if { (eval echo configure:5084: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_mkdir_takes_one_arg=no
else
@@ -5107,6 +5196,71 @@ objext='.o'
+# With Setjmp/Longjmp based exception handling.
+# Check whether --enable-sjlj-exceptions or --disable-sjlj-exceptions was given.
+if test "${enable_sjlj_exceptions+set}" = set; then
+ enableval="$enable_sjlj_exceptions"
+ sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi`
+cat >> confdefs.h <<EOF
+#define CONFIG_SJLJ_EXCEPTIONS $sjlj
+EOF
+
+fi
+
+
+echo $ac_n "checking for main in -lunwind""... $ac_c" 1>&6
+echo "configure:5213: 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
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lunwind $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5221 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:5228: \"$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
+ 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"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ use_libunwind_default=yes
+else
+ echo "$ac_t""no" 1>&6
+use_libunwind_default=no
+fi
+
+# Use libunwind based exception handling.
+# Check whether --enable-libunwind-exceptions or --disable-libunwind-exceptions was given.
+if test "${enable_libunwind_exceptions+set}" = set; then
+ enableval="$enable_libunwind_exceptions"
+ use_libunwind_exceptions=$enableval
+else
+ use_libunwind_exceptions=$use_libunwind_default
+fi
+
+if test x"$use_libunwind_exceptions" = xyes; then
+ cat >> confdefs.h <<\EOF
+#define USE_LIBUNWIND_EXCEPTIONS 1
+EOF
+
+fi
+
target_gtfiles=
build_xm_file=
build_xm_defines=
@@ -5196,6 +5350,13 @@ else
done
fi
+if test x$need_64bit_hwint = xyes; then
+ cat >> confdefs.h <<\EOF
+#define NEED_64BIT_HOST_WIDE_INT 1
+EOF
+
+fi
+
count=a
for f in $host_xm_file; do
count=${count}x
@@ -5252,7 +5413,7 @@ fi
# auto-host.h is the file containing items generated by autoconf and is
# the first file included by config.h.
-# If host=build, it is correct to have hconfig include auto-host.h
+# If host=build, it is correct to have bconfig include auto-host.h
# as well. If host!=build, we are in error and need to do more
# work to find out the build config parameters.
if test x$host = x$build
@@ -5289,9 +5450,10 @@ fi
tm_file="${tm_file} defaults.h"
-host_xm_file="auto-host.h ansidecl.h ${host_xm_file} ${tm_file}"
-build_xm_file="${build_auto} ansidecl.h ${build_xm_file} ${tm_file}"
-xm_file="ansidecl.h ${xm_file} ${tm_file}"
+tm_p_file="${tm_p_file} tm-preds.h"
+host_xm_file="auto-host.h ansidecl.h ${host_xm_file}"
+build_xm_file="${build_auto} ansidecl.h ${build_xm_file}"
+xm_file="ansidecl.h ${xm_file}"
# Truncate the target if necessary
if test x$host_truncate_target != x; then
@@ -5348,14 +5510,14 @@ fi
echo $ac_n "checking for library containing strerror""... $ac_c" 1>&6
-echo "configure:5352: checking for library containing strerror" >&5
+echo "configure:5514: checking for library containing strerror" >&5
if eval "test \"`echo '$''{'ac_cv_search_strerror'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_strerror="no"
cat > conftest.$ac_ext <<EOF
-#line 5359 "configure"
+#line 5521 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5366,7 +5528,7 @@ int main() {
strerror()
; return 0; }
EOF
-if { (eval echo configure:5370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_strerror="none required"
else
@@ -5377,7 +5539,7 @@ rm -f conftest*
test "$ac_cv_search_strerror" = "no" && for i in cposix; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5381 "configure"
+#line 5543 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5388,7 +5550,7 @@ int main() {
strerror()
; return 0; }
EOF
-if { (eval echo configure:5392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_strerror="-l$i"
break
@@ -5411,12 +5573,12 @@ fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:5415: checking for working const" >&5
+echo "configure:5577: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5420 "configure"
+#line 5582 "configure"
#include "confdefs.h"
int main() {
@@ -5465,7 +5627,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:5469: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5631: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -5486,12 +5648,12 @@ EOF
fi
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:5490: checking for off_t" >&5
+echo "configure:5652: 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
else
cat > conftest.$ac_ext <<EOF
-#line 5495 "configure"
+#line 5657 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -5519,12 +5681,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:5523: checking for size_t" >&5
+echo "configure:5685: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5528 "configure"
+#line 5690 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -5554,19 +5716,19 @@ fi
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:5558: checking for working alloca.h" >&5
+echo "configure:5720: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5563 "configure"
+#line 5725 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:5570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -5587,12 +5749,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:5591: checking for alloca" >&5
+echo "configure:5753: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5596 "configure"
+#line 5758 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -5620,7 +5782,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:5624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -5652,12 +5814,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:5656: checking whether alloca needs Cray hooks" >&5
+echo "configure:5818: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5661 "configure"
+#line 5823 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -5682,12 +5844,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5686: checking for $ac_func" >&5
+echo "configure:5848: 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 <<EOF
-#line 5691 "configure"
+#line 5853 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5710,7 +5872,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5876: \"$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
@@ -5737,7 +5899,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:5741: checking stack direction for C alloca" >&5
+echo "configure:5903: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5745,7 +5907,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 5749 "configure"
+#line 5911 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -5764,7 +5926,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:5768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -5787,12 +5949,12 @@ fi
echo $ac_n "checking whether we are using the GNU C Library 2.1 or newer""... $ac_c" 1>&6
-echo "configure:5791: checking whether we are using the GNU C Library 2.1 or newer" >&5
+echo "configure:5953: checking whether we are using the GNU C Library 2.1 or newer" >&5
if eval "test \"`echo '$''{'ac_cv_gnu_library_2_1'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5796 "configure"
+#line 5958 "configure"
#include "confdefs.h"
#include <features.h>
@@ -5828,17 +5990,17 @@ stdlib.h string.h unistd.h sys/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5832: checking for $ac_hdr" >&5
+echo "configure:5994: 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
-#line 5837 "configure"
+#line 5999 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5842: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6004: \"$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*
@@ -5869,12 +6031,12 @@ getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
strdup strtoul tsearch __argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5873: checking for $ac_func" >&5
+echo "configure:6035: 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 <<EOF
-#line 5878 "configure"
+#line 6040 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5897,7 +6059,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6063: \"$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
@@ -5938,7 +6100,7 @@ fi
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:5942: checking for iconv" >&5
+echo "configure:6104: checking for iconv" >&5
if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5946,7 +6108,7 @@ else
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
cat > conftest.$ac_ext <<EOF
-#line 5950 "configure"
+#line 6112 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -5956,7 +6118,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:5960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_func_iconv=yes
else
@@ -5968,7 +6130,7 @@ rm -f conftest*
am_save_LIBS="$LIBS"
LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
cat > conftest.$ac_ext <<EOF
-#line 5972 "configure"
+#line 6134 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -5978,7 +6140,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:5982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6144: \"$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
@@ -5999,13 +6161,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
EOF
echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:6003: checking for iconv declaration" >&5
+echo "configure:6165: 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 <<EOF
-#line 6009 "configure"
+#line 6171 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -6024,7 +6186,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:6028: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6190: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_proto_iconv_arg1=""
else
@@ -6053,19 +6215,19 @@ EOF
echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6
-echo "configure:6057: checking for nl_langinfo and CODESET" >&5
+echo "configure:6219: checking for nl_langinfo and CODESET" >&5
if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6062 "configure"
+#line 6224 "configure"
#include "confdefs.h"
#include <langinfo.h>
int main() {
char* cs = nl_langinfo(CODESET);
; return 0; }
EOF
-if { (eval echo configure:6069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_langinfo_codeset=yes
else
@@ -6088,19 +6250,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:6092: checking for LC_MESSAGES" >&5
+echo "configure:6254: 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 <<EOF
-#line 6097 "configure"
+#line 6259 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:6104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6266: \"$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
@@ -6121,7 +6283,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:6125: checking whether NLS is requested" >&5
+echo "configure:6287: checking whether NLS is requested" >&5
# Check whether --enable-nls or --disable-nls was given.
if test "${enable_nls+set}" = set; then
enableval="$enable_nls"
@@ -6144,7 +6306,7 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:6148: checking whether included gettext is requested" >&5
+echo "configure:6310: checking whether included gettext is requested" >&5
# Check whether --with-included-gettext or --without-included-gettext was given.
if test "${with_included_gettext+set}" = set; then
withval="$with_included_gettext"
@@ -6164,17 +6326,17 @@ fi
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:6168: checking for libintl.h" >&5
+echo "configure:6330: checking for libintl.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
-#line 6173 "configure"
+#line 6335 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6340: \"$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*
@@ -6195,12 +6357,12 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
EOF
echo $ac_n "checking for GNU gettext in libc""... $ac_c" 1>&6
-echo "configure:6199: checking for GNU gettext in libc" >&5
+echo "configure:6361: checking for GNU gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6204 "configure"
+#line 6366 "configure"
#include "confdefs.h"
#include <libintl.h>
extern int _nl_msg_cat_cntr;
@@ -6209,7 +6371,7 @@ bindtextdomain ("", "");
return (int) gettext ("") + _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:6213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gnugettext1_libc=yes
else
@@ -6225,14 +6387,14 @@ echo "$ac_t""$gt_cv_func_gnugettext1_libc" 1>&6
if test "$gt_cv_func_gnugettext1_libc" != "yes"; then
echo $ac_n "checking for GNU gettext in libintl""... $ac_c" 1>&6
-echo "configure:6229: checking for GNU gettext in libintl" >&5
+echo "configure:6391: checking for GNU gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
gt_save_LIBS="$LIBS"
LIBS="$LIBS -lintl $LIBICONV"
cat > conftest.$ac_ext <<EOF
-#line 6236 "configure"
+#line 6398 "configure"
#include "confdefs.h"
#include <libintl.h>
extern int _nl_msg_cat_cntr;
@@ -6241,7 +6403,7 @@ bindtextdomain ("", "");
return (int) gettext ("") + _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:6245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gnugettext1_libintl=yes
else
@@ -6274,12 +6436,12 @@ EOF
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6278: checking for $ac_func" >&5
+echo "configure:6440: 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 <<EOF
-#line 6283 "configure"
+#line 6445 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6302,7 +6464,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6468: \"$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
@@ -6331,7 +6493,7 @@ done
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6335: checking for $ac_word" >&5
+echo "configure:6497: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6365,7 +6527,7 @@ fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6369: checking for $ac_word" >&5
+echo "configure:6531: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6402,7 +6564,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6406: checking for $ac_word" >&5
+echo "configure:6568: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6452,7 +6614,7 @@ fi
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6456: checking for $ac_word" >&5
+echo "configure:6618: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6486,7 +6648,7 @@ fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6490: checking for $ac_word" >&5
+echo "configure:6652: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6522,7 +6684,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6526: checking for $ac_word" >&5
+echo "configure:6688: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6594,7 +6756,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:6598: checking for $ac_word" >&5
+echo "configure:6760: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_INTLBISON'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6627,7 +6789,7 @@ done
ac_verc_fail=yes
else
echo $ac_n "checking version of bison""... $ac_c" 1>&6
-echo "configure:6631: checking version of bison" >&5
+echo "configure:6793: checking version of bison" >&5
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
@@ -6672,7 +6834,7 @@ EOF
if test "x$CATOBJEXT" != x; then
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:6676: checking for catalogs to be installed" >&5
+echo "configure:6838: checking for catalogs to be installed" >&5
# Look for .po and .gmo files in the source directory.
CATALOGS=
XLINGUAS=
@@ -6730,7 +6892,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:6734: checking whether windows registry support is requested" >&5
+echo "configure:6896: 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
@@ -6739,14 +6901,14 @@ EOF
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for library containing RegOpenKeyExA""... $ac_c" 1>&6
-echo "configure:6743: checking for library containing RegOpenKeyExA" >&5
+echo "configure:6905: 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 <<EOF
-#line 6750 "configure"
+#line 6912 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6757,7 +6919,7 @@ int main() {
RegOpenKeyExA()
; return 0; }
EOF
-if { (eval echo configure:6761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6923: \"$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
@@ -6768,7 +6930,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 <<EOF
-#line 6772 "configure"
+#line 6934 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6779,7 +6941,7 @@ int main() {
RegOpenKeyExA()
; return 0; }
EOF
-if { (eval echo configure:6783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6945: \"$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
@@ -6821,7 +6983,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:6825: checking registry key on windows hosts" >&5
+echo "configure:6987: checking registry key on windows hosts" >&5
cat >> confdefs.h <<EOF
#define WIN32_REGISTRY_KEY "$gcc_cv_win32_registry_key"
EOF
@@ -6903,7 +7065,11 @@ done
tm_p_file_list=
for f in $tm_p_file; do
- tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f"
+ case $f in
+ tm-preds.h )
+ tm_p_file_list="${tm_p_file_list} $f" ;;
+ *) tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f" ;;
+ esac
done
host_xm_file_list=
@@ -6957,26 +7123,21 @@ fi
# This prevents libgcc2 from containing any code which requires libc
# support.
inhibit_libc=
-if test x$host != x$target && test x$with_headers = x; then
+if { test x$host != x$target && test "x$with_headers" = x &&
+ test "x$with_sysroot" = x ; } || test x$with_newlib = xyes ; then
inhibit_libc=-Dinhibit_libc
-else
- if test x$with_newlib = xyes; then
- inhibit_libc=-Dinhibit_libc
- fi
fi
# When building gcc with a cross-compiler, we need to adjust things so
# that the generator programs are still built with the native compiler.
# Also, we cannot run fixincludes or fix-header.
-# Note that the terminology here is wrong; it should be BUILD_* throughout.
-# FIXME.
# These are the normal (build=host) settings:
BUILD_PREFIX=
BUILD_PREFIX_1=ignore-
-HOST_CC='$(CC)'
-HOST_CFLAGS='$(ALL_CFLAGS)'
+BUILD_CC='$(CC)'
+BUILD_CFLAGS='$(ALL_CFLAGS)'
STMP_FIXINC=stmp-fixinc
STMP_FIXPROTO=stmp-fixproto
@@ -6986,8 +7147,8 @@ if test x$build != x$host
then
BUILD_PREFIX=build-
BUILD_PREFIX_1=build-
- HOST_CC='$(CC_FOR_BUILD)'
- HOST_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD) $(XCFLAGS)'
+ BUILD_CC='$(CC_FOR_BUILD)'
+ BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD) $(XCFLAGS)'
STMP_FIXINC=
STMP_FIXPROTO=
@@ -7035,7 +7196,7 @@ fi
# Figure out what assembler we will be using.
echo $ac_n "checking what assembler to use""... $ac_c" 1>&6
-echo "configure:7039: checking what assembler to use" >&5
+echo "configure:7200: checking what assembler to use" >&5
gcc_cv_as=
gcc_cv_gas_major_version=
gcc_cv_gas_minor_version=
@@ -7129,7 +7290,7 @@ fi
# Figure out what linker we will be using.
echo $ac_n "checking what linker to use""... $ac_c" 1>&6
-echo "configure:7133: checking what linker to use" >&5
+echo "configure:7294: checking what linker to use" >&5
gcc_cv_ld=
gcc_cv_gld_major_version=
gcc_cv_gld_minor_version=
@@ -7222,7 +7383,7 @@ fi
# Figure out what nm we will be using.
echo $ac_n "checking what nm to use""... $ac_c" 1>&6
-echo "configure:7226: checking what nm to use" >&5
+echo "configure:7387: checking what nm to use" >&5
if test -x nm$host_exeext; then
gcc_cv_nm=./nm$host_exeext
elif test "x$program_prefix" != xNONE; then
@@ -7234,7 +7395,7 @@ echo "$ac_t""$gcc_cv_nm" 1>&6
# Figure out what objdump we will be using.
echo $ac_n "checking what objdump to use""... $ac_c" 1>&6
-echo "configure:7238: checking what objdump to use" >&5
+echo "configure:7399: checking what objdump to use" >&5
if test -x objdump$host_exeext; then
gcc_cv_objdump=./objdump$host_exeext
elif test "x$program_prefix" != xNONE; then
@@ -7246,7 +7407,7 @@ echo "$ac_t""$gcc_cv_objdump" 1>&6
# Figure out what assembler alignment features are present.
echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6
-echo "configure:7250: checking assembler alignment features" >&5
+echo "configure:7411: checking assembler alignment features" >&5
gcc_cv_as_alignment_features=none
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
# Gas version 2.6 and later support for .balign and .p2align.
@@ -7294,7 +7455,7 @@ fi
echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6
echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6
-echo "configure:7298: checking assembler subsection support" >&5
+echo "configure:7459: checking assembler subsection support" >&5
gcc_cv_as_subsections=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
@@ -7334,7 +7495,7 @@ fi
echo "$ac_t""$gcc_cv_as_subsections" 1>&6
echo $ac_n "checking assembler weak support""... $ac_c" 1>&6
-echo "configure:7338: checking assembler weak support" >&5
+echo "configure:7499: checking assembler weak support" >&5
gcc_cv_as_weak=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 2 -o "$gcc_cv_gas_major_version" -gt 2; then
@@ -7357,7 +7518,7 @@ fi
echo "$ac_t""$gcc_cv_as_weak" 1>&6
echo $ac_n "checking assembler hidden support""... $ac_c" 1>&6
-echo "configure:7361: checking assembler hidden support" >&5
+echo "configure:7522: checking assembler hidden support" >&5
gcc_cv_as_hidden=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 \
@@ -7429,7 +7590,7 @@ esac
echo $ac_n "checking assembler leb128 support""... $ac_c" 1>&6
-echo "configure:7433: checking assembler leb128 support" >&5
+echo "configure:7594: checking assembler leb128 support" >&5
gcc_cv_as_leb128=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 11 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
@@ -7474,7 +7635,7 @@ fi
echo "$ac_t""$gcc_cv_as_leb128" 1>&6
echo $ac_n "checking assembler eh_frame optimization""... $ac_c" 1>&6
-echo "configure:7478: checking assembler eh_frame optimization" >&5
+echo "configure:7639: checking assembler eh_frame optimization" >&5
gcc_cv_as_eh_frame=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
@@ -7555,7 +7716,7 @@ fi
echo "$ac_t""$gcc_cv_as_eh_frame" 1>&6
echo $ac_n "checking assembler section merging support""... $ac_c" 1>&6
-echo "configure:7559: checking assembler section merging support" >&5
+echo "configure:7720: checking assembler section merging support" >&5
gcc_cv_as_shf_merge=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
@@ -7578,7 +7739,7 @@ fi
echo "$ac_t""$gcc_cv_as_shf_merge" 1>&6
echo $ac_n "checking assembler thread-local storage support""... $ac_c" 1>&6
-echo "configure:7582: checking assembler thread-local storage support" >&5
+echo "configure:7743: checking assembler thread-local storage support" >&5
gcc_cv_as_tls=no
conftest_s=
tls_first_major=
@@ -7686,7 +7847,7 @@ case "$target" in
# All TARGET_ABI_OSF targets.
alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*)
echo $ac_n "checking assembler supports explicit relocations""... $ac_c" 1>&6
-echo "configure:7690: checking assembler supports explicit relocations" >&5
+echo "configure:7851: checking assembler supports explicit relocations" >&5
if eval "test \"`echo '$''{'gcc_cv_as_explicit_relocs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7736,7 +7897,7 @@ EOF
;;
sparc*-*-*)
echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6
-echo "configure:7740: checking assembler .register pseudo-op support" >&5
+echo "configure:7901: checking assembler .register pseudo-op support" >&5
if eval "test \"`echo '$''{'gcc_cv_as_register_pseudo_op'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7764,7 +7925,7 @@ EOF
fi
echo $ac_n "checking assembler supports -relax""... $ac_c" 1>&6
-echo "configure:7768: checking assembler supports -relax" >&5
+echo "configure:7929: checking assembler supports -relax" >&5
if eval "test \"`echo '$''{'gcc_cv_as_relax_opt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7792,7 +7953,7 @@ EOF
fi
echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6
-echo "configure:7796: checking assembler and linker support unaligned pc related relocs" >&5
+echo "configure:7957: checking assembler and linker support unaligned pc related relocs" >&5
if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7819,7 +7980,7 @@ EOF
fi
echo $ac_n "checking assembler and linker support unaligned pc related relocs against hidden symbols""... $ac_c" 1>&6
-echo "configure:7823: checking assembler and linker support unaligned pc related relocs against hidden symbols" >&5
+echo "configure:7984: checking assembler and linker support unaligned pc related 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
@@ -7859,7 +8020,7 @@ EOF
fi
echo $ac_n "checking for assembler offsetable %lo() support""... $ac_c" 1>&6
-echo "configure:7863: checking for assembler offsetable %lo() support" >&5
+echo "configure:8024: checking for assembler offsetable %lo() support" >&5
if eval "test \"`echo '$''{'gcc_cv_as_offsetable_lo10'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7898,7 +8059,7 @@ EOF
i[34567]86-*-* | x86_64-*-*)
echo $ac_n "checking assembler instructions""... $ac_c" 1>&6
-echo "configure:7902: checking assembler instructions" >&5
+echo "configure:8063: checking assembler instructions" >&5
gcc_cv_as_instructions=
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2; then
@@ -7925,7 +8086,7 @@ EOF
echo "$ac_t""$gcc_cv_as_instructions" 1>&6
echo $ac_n "checking assembler GOTOFF in data directives""... $ac_c" 1>&6
-echo "configure:7929: checking assembler GOTOFF in data directives" >&5
+echo "configure:8090: checking assembler GOTOFF in data directives" >&5
gcc_cv_as_gotoff_in_data=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x
then
@@ -7955,7 +8116,7 @@ EOF
esac
echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6
-echo "configure:7959: checking assembler dwarf2 debug_line support" >&5
+echo "configure:8120: checking assembler dwarf2 debug_line support" >&5
gcc_cv_as_dwarf2_debug_line=no
# ??? Not all targets support dwarf2 debug_line, even within a version
# of gas. Moreover, we need to emit a valid instruction to trigger any
@@ -8012,7 +8173,7 @@ fi
echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6
echo $ac_n "checking assembler --gdwarf2 support""... $ac_c" 1>&6
-echo "configure:8016: checking assembler --gdwarf2 support" >&5
+echo "configure:8177: checking assembler --gdwarf2 support" >&5
gcc_cv_as_gdwarf2_flag=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
then
@@ -8041,7 +8202,7 @@ fi
echo "$ac_t""$gcc_cv_as_gdwarf2_flag" 1>&6
echo $ac_n "checking assembler --gstabs support""... $ac_c" 1>&6
-echo "configure:8045: checking assembler --gstabs support" >&5
+echo "configure:8206: checking assembler --gstabs support" >&5
gcc_cv_as_gstabs_flag=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
then
@@ -8069,7 +8230,7 @@ fi
echo "$ac_t""$gcc_cv_as_gstabs_flag" 1>&6
echo $ac_n "checking linker read-only and read-write section mixing""... $ac_c" 1>&6
-echo "configure:8073: checking linker read-only and read-write section mixing" >&5
+echo "configure:8234: checking linker read-only and read-write section mixing" >&5
gcc_cv_ld_ro_rw_mix=unknown
if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; 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 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
@@ -8107,7 +8268,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:8111: checking linker PT_GNU_EH_FRAME support" >&5
+echo "configure:8272: checking linker PT_GNU_EH_FRAME support" >&5
gcc_cv_ld_eh_frame_hdr=no
if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; 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 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
@@ -8131,7 +8292,7 @@ echo "$ac_t""$gcc_cv_ld_eh_frame_hdr" 1>&6
case "$target" in
mips*-*-*)
echo $ac_n "checking whether libgloss uses STARTUP directives consistently""... $ac_c" 1>&6
-echo "configure:8135: checking whether libgloss uses STARTUP directives consistently" >&5
+echo "configure:8296: 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
@@ -8335,7 +8496,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:8339: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:8500: 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"
@@ -8353,34 +8514,6 @@ else
MAINT='#'
fi
-# With Setjmp/Longjmp based exception handling.
-# Check whether --enable-sjlj-exceptions or --disable-sjlj-exceptions was given.
-if test "${enable_sjlj_exceptions+set}" = set; then
- enableval="$enable_sjlj_exceptions"
- sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi`
-cat >> confdefs.h <<EOF
-#define CONFIG_SJLJ_EXCEPTIONS $sjlj
-EOF
-
-fi
-
-
-# Use libunwind based exception handling.
-# Check whether --enable-libunwind-exceptions or --disable-libunwind-exceptions was given.
-if test "${enable_libunwind_exceptions+set}" = set; then
- enableval="$enable_libunwind_exceptions"
- use_libunwind_exceptions=$enableval
-else
- use_libunwind_exceptions=no
-fi
-
-if test x"$use_libunwind_exceptions" = xyes; then
- cat >> confdefs.h <<\EOF
-#define USE_LIBUNWIND_EXCEPTIONS 1
-EOF
-
-fi
-
# Make empty files to contain the specs and options for each language.
# Then add #include lines to for a compiler that has specs and/or options.
@@ -8874,6 +9007,9 @@ s%@valgrind_path_defines@%$valgrind_path_defines%g
s%@valgrind_command@%$valgrind_command%g
s%@coverage_flags@%$coverage_flags%g
s%@enable_shared@%$enable_shared%g
+s%@TARGET_SYSTEM_ROOT@%$TARGET_SYSTEM_ROOT%g
+s%@TARGET_SYSTEM_ROOT_DEFINE@%$TARGET_SYSTEM_ROOT_DEFINE%g
+s%@CROSS_SYSTEM_HEADER_DIR@%$CROSS_SYSTEM_HEADER_DIR%g
s%@stage1_cflags@%$stage1_cflags%g
s%@SET_MAKE@%$SET_MAKE%g
s%@AWK@%$AWK%g
@@ -8926,8 +9062,8 @@ s%@SYSTEM_HEADER_DIR@%$SYSTEM_HEADER_DIR%g
s%@inhibit_libc@%$inhibit_libc%g
s%@BUILD_PREFIX@%$BUILD_PREFIX%g
s%@BUILD_PREFIX_1@%$BUILD_PREFIX_1%g
-s%@HOST_CC@%$HOST_CC%g
-s%@HOST_CFLAGS@%$HOST_CFLAGS%g
+s%@BUILD_CC@%$BUILD_CC%g
+s%@BUILD_CFLAGS@%$BUILD_CFLAGS%g
s%@STMP_FIXINC@%$STMP_FIXINC%g
s%@STMP_FIXPROTO@%$STMP_FIXPROTO%g
s%@libgcc_visibility@%$libgcc_visibility%g
diff --git a/gcc/configure.in b/gcc/configure.in
index c0afb232296..cb01381e6de 100644
--- a/gcc/configure.in
+++ b/gcc/configure.in
@@ -237,14 +237,14 @@ gcc_AC_C_LONG_LONG
gcc_AC_C__BOOL
# sizeof(char) is 1 by definition.
-gcc_AC_COMPILE_CHECK_SIZEOF(short)
-gcc_AC_COMPILE_CHECK_SIZEOF(int)
-gcc_AC_COMPILE_CHECK_SIZEOF(long)
+AC_COMPILE_CHECK_SIZEOF(short)
+AC_COMPILE_CHECK_SIZEOF(int)
+AC_COMPILE_CHECK_SIZEOF(long)
if test $ac_cv_c_long_long = yes; then
- gcc_AC_COMPILE_CHECK_SIZEOF(long long)
+ AC_COMPILE_CHECK_SIZEOF(long long)
fi
if test $ac_cv_c___int64 = yes; then
- gcc_AC_COMPILE_CHECK_SIZEOF(__int64)
+ AC_COMPILE_CHECK_SIZEOF(__int64)
fi
gcc_AC_C_CHARSET
@@ -475,6 +475,25 @@ AC_ARG_ENABLE(shared,
], [enable_shared=yes])
AC_SUBST(enable_shared)
+AC_ARG_WITH(sysroot,
+[ --with-sysroot[=DIR] Search for usr/lib, usr/include, et al, within DIR.],
+[
+ case ${with_sysroot} in
+ yes) TARGET_SYSTEM_ROOT='${gcc_tooldir}/sys-root' ;;
+ *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
+ esac
+
+ TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
+ CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR)'
+], [
+ TARGET_SYSTEM_ROOT=
+ TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=0'
+ CROSS_SYSTEM_HEADER_DIR='$(gcc_tooldir)/sys-include'
+])
+AC_SUBST(TARGET_SYSTEM_ROOT)
+AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
+AC_SUBST(CROSS_SYSTEM_HEADER_DIR)
+
# Stage specific cflags for build.
stage1_cflags=
case $build in
@@ -557,7 +576,7 @@ AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=])
# These tests can't be done till we know if we have limits.h.
gcc_AC_C_CHAR_BIT
-gcc_AC_C_COMPILE_ENDIAN
+AC_C_BIGENDIAN_CROSS
gcc_AC_C_FLOAT_FORMAT
# See if we have the mktemp command.
@@ -780,6 +799,25 @@ objext='.o'
AC_SUBST(manext)
AC_SUBST(objext)
+# With Setjmp/Longjmp based exception handling.
+AC_ARG_ENABLE(sjlj-exceptions,
+[ --enable-sjlj-exceptions
+ arrange to use setjmp/longjmp exception handling],
+[sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi`
+AC_DEFINE_UNQUOTED(CONFIG_SJLJ_EXCEPTIONS, $sjlj,
+ [Define 0/1 to force the choice for exception handling model.])])
+
+AC_CHECK_LIB(unwind, main, use_libunwind_default=yes, use_libunwind_default=no)
+# Use libunwind based exception handling.
+AC_ARG_ENABLE(libunwind-exceptions,
+[ --enable-libunwind-exceptions force use libunwind for exceptions],
+use_libunwind_exceptions=$enableval,
+use_libunwind_exceptions=$use_libunwind_default)
+if test x"$use_libunwind_exceptions" = xyes; then
+ AC_DEFINE(USE_LIBUNWIND_EXCEPTIONS, 1,
+ [Define if gcc should use -lunwind.])
+fi
+
target_gtfiles=
build_xm_file=
build_xm_defines=
@@ -869,6 +907,11 @@ else
done
fi
+if test x$need_64bit_hwint = xyes; then
+ AC_DEFINE(NEED_64BIT_HOST_WIDE_INT, 1,
+[Define to 1 if HOST_WIDE_INT must be 64 bits wide (see hwint.h).])
+fi
+
count=a
for f in $host_xm_file; do
count=${count}x
@@ -923,7 +966,7 @@ fi
# auto-host.h is the file containing items generated by autoconf and is
# the first file included by config.h.
-# If host=build, it is correct to have hconfig include auto-host.h
+# If host=build, it is correct to have bconfig include auto-host.h
# as well. If host!=build, we are in error and need to do more
# work to find out the build config parameters.
if test x$host = x$build
@@ -960,9 +1003,10 @@ fi
AC_SUBST(FORBUILD)
tm_file="${tm_file} defaults.h"
-host_xm_file="auto-host.h ansidecl.h ${host_xm_file} ${tm_file}"
-build_xm_file="${build_auto} ansidecl.h ${build_xm_file} ${tm_file}"
-xm_file="ansidecl.h ${xm_file} ${tm_file}"
+tm_p_file="${tm_p_file} tm-preds.h"
+host_xm_file="auto-host.h ansidecl.h ${host_xm_file}"
+build_xm_file="${build_auto} ansidecl.h ${build_xm_file}"
+xm_file="ansidecl.h ${xm_file}"
# Truncate the target if necessary
if test x$host_truncate_target != x; then
@@ -1134,7 +1178,11 @@ done
tm_p_file_list=
for f in $tm_p_file; do
- tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f"
+ case $f in
+ tm-preds.h )
+ tm_p_file_list="${tm_p_file_list} $f" ;;
+ *) tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f" ;;
+ esac
done
host_xm_file_list=
@@ -1188,26 +1236,21 @@ fi
# This prevents libgcc2 from containing any code which requires libc
# support.
inhibit_libc=
-if [test x$host != x$target] && [test x$with_headers = x]; then
+if { test x$host != x$target && test "x$with_headers" = x &&
+ test "x$with_sysroot" = x ; } || test x$with_newlib = xyes ; then
inhibit_libc=-Dinhibit_libc
-else
- if [test x$with_newlib = xyes]; then
- inhibit_libc=-Dinhibit_libc
- fi
fi
AC_SUBST(inhibit_libc)
# When building gcc with a cross-compiler, we need to adjust things so
# that the generator programs are still built with the native compiler.
# Also, we cannot run fixincludes or fix-header.
-# Note that the terminology here is wrong; it should be BUILD_* throughout.
-# FIXME.
# These are the normal (build=host) settings:
BUILD_PREFIX= AC_SUBST(BUILD_PREFIX)
BUILD_PREFIX_1=ignore- AC_SUBST(BUILD_PREFIX_1)
-HOST_CC='$(CC)' AC_SUBST(HOST_CC)
-HOST_CFLAGS='$(ALL_CFLAGS)' AC_SUBST(HOST_CFLAGS)
+BUILD_CC='$(CC)' AC_SUBST(BUILD_CC)
+BUILD_CFLAGS='$(ALL_CFLAGS)' AC_SUBST(BUILD_CFLAGS)
STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_FIXINC)
STMP_FIXPROTO=stmp-fixproto AC_SUBST(STMP_FIXPROTO)
@@ -1217,8 +1260,8 @@ if test x$build != x$host
then
BUILD_PREFIX=build-
BUILD_PREFIX_1=build-
- HOST_CC='$(CC_FOR_BUILD)'
- HOST_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD) $(XCFLAGS)'
+ BUILD_CC='$(CC_FOR_BUILD)'
+ BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD) $(XCFLAGS)'
STMP_FIXINC=
STMP_FIXPROTO=
@@ -2483,24 +2526,6 @@ else
fi
AC_SUBST(MAINT)dnl
-# With Setjmp/Longjmp based exception handling.
-AC_ARG_ENABLE(sjlj-exceptions,
-[ --enable-sjlj-exceptions
- arrange to use setjmp/longjmp exception handling],
-[sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi`
-AC_DEFINE_UNQUOTED(CONFIG_SJLJ_EXCEPTIONS, $sjlj,
- [Define 0/1 to force the choice for exception handling model.])])
-
-# Use libunwind based exception handling.
-AC_ARG_ENABLE(libunwind-exceptions,
-[ --enable-libunwind-exceptions force use libunwind for exceptions],
-use_libunwind_exceptions=$enableval,
-use_libunwind_exceptions=no)
-if test x"$use_libunwind_exceptions" = xyes; then
- AC_DEFINE(USE_LIBUNWIND_EXCEPTIONS, 1,
- [Define if gcc should use -lunwind.])
-fi
-
# Make empty files to contain the specs and options for each language.
# Then add #include lines to for a compiler that has specs and/or options.
diff --git a/gcc/conflict.c b/gcc/conflict.c
index a6d755499bb..3848b378b03 100644
--- a/gcc/conflict.c
+++ b/gcc/conflict.c
@@ -27,6 +27,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "obstack.h"
#include "hashtab.h"
#include "rtl.h"
diff --git a/gcc/convert.c b/gcc/convert.c
index e440e35f575..2ceccac41b3 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -25,11 +25,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "flags.h"
#include "convert.h"
#include "toplev.h"
#include "langhooks.h"
+static tree strip_float_extensions PARAMS ((tree));
/* Convert EXPR to some pointer or reference type TYPE.
@@ -71,6 +74,30 @@ convert_to_pointer (type, expr)
}
}
+/* Avoid any floating point extensions from EXP. */
+static tree
+strip_float_extensions (exp)
+ tree exp;
+{
+ tree sub, expt, subt;
+
+ if (TREE_CODE (exp) != NOP_EXPR)
+ return exp;
+
+ sub = TREE_OPERAND (exp, 0);
+ subt = TREE_TYPE (sub);
+ expt = TREE_TYPE (exp);
+
+ if (!FLOAT_TYPE_P (subt))
+ return exp;
+
+ if (TYPE_PRECISION (subt) > TYPE_PRECISION (expt))
+ return exp;
+
+ return strip_float_extensions (sub);
+}
+
+
/* Convert EXPR to some floating-point type TYPE.
EXPR must be float, integer, or enumeral;
@@ -80,6 +107,140 @@ tree
convert_to_real (type, expr)
tree type, expr;
{
+ enum built_in_function fcode = builtin_mathfn_code (expr);
+ tree itype = TREE_TYPE (expr);
+
+ /* Convert (float)sqrt((double)x) where x is float into sqrtf(x) */
+ if ((fcode == BUILT_IN_SQRT
+ || fcode == BUILT_IN_SQRTL
+ || fcode == BUILT_IN_SIN
+ || fcode == BUILT_IN_SINL
+ || fcode == BUILT_IN_COS
+ || fcode == BUILT_IN_COSL
+ || fcode == BUILT_IN_EXP
+ || fcode == BUILT_IN_EXPL)
+ && optimize
+ && (TYPE_MODE (type) == TYPE_MODE (double_type_node)
+ || TYPE_MODE (type) == TYPE_MODE (float_type_node)))
+ {
+ tree arg0 = strip_float_extensions (TREE_VALUE (TREE_OPERAND (expr, 1)));
+ tree newtype = type;
+
+ /* We have (outertype)sqrt((innertype)x). Choose the wider mode from
+ the both as the safe type for operation. */
+ if (TYPE_PRECISION (TREE_TYPE (arg0)) > TYPE_PRECISION (type))
+ newtype = TREE_TYPE (arg0);
+
+ /* Be curefull about integer to fp conversions.
+ These may overflow still. */
+ if (FLOAT_TYPE_P (TREE_TYPE (arg0))
+ && TYPE_PRECISION (newtype) <= TYPE_PRECISION (itype)
+ && (TYPE_MODE (newtype) == TYPE_MODE (double_type_node)
+ || TYPE_MODE (newtype) == TYPE_MODE (float_type_node)))
+ {
+ tree arglist;
+ if (TYPE_MODE (type) == TYPE_MODE (float_type_node))
+ switch (fcode)
+ {
+ case BUILT_IN_SQRT:
+ case BUILT_IN_SQRTL:
+ fcode = BUILT_IN_SQRTF;
+ break;
+ case BUILT_IN_SIN:
+ case BUILT_IN_SINL:
+ fcode = BUILT_IN_SINF;
+ break;
+ case BUILT_IN_COS:
+ case BUILT_IN_COSL:
+ fcode = BUILT_IN_COSF;
+ break;
+ case BUILT_IN_EXP:
+ case BUILT_IN_EXPL:
+ fcode = BUILT_IN_EXPF;
+ break;
+ default:
+ abort ();
+ }
+ else
+ switch (fcode)
+ {
+ case BUILT_IN_SQRT:
+ case BUILT_IN_SQRTL:
+ fcode = BUILT_IN_SQRT;
+ break;
+ case BUILT_IN_SIN:
+ case BUILT_IN_SINL:
+ fcode = BUILT_IN_SIN;
+ break;
+ case BUILT_IN_COS:
+ case BUILT_IN_COSL:
+ fcode = BUILT_IN_COS;
+ break;
+ case BUILT_IN_EXP:
+ case BUILT_IN_EXPL:
+ fcode = BUILT_IN_EXP;
+ break;
+ default:
+ abort ();
+ }
+
+ /* ??? Fortran frontend does not initialize built_in_decls.
+ For some reason creating the decl using builtin_function does not
+ work as it should. */
+ if (built_in_decls [fcode])
+ {
+ arglist = build_tree_list (NULL_TREE, fold (convert_to_real (newtype, arg0)));
+ expr = build_function_call_expr (built_in_decls [fcode], arglist);
+ if (newtype == type)
+ return expr;
+ }
+ }
+ }
+
+ /* Propagate the cast into the operation. */
+ if (itype != type && FLOAT_TYPE_P (type))
+ switch (TREE_CODE (expr))
+ {
+ /* convert (float)-x into -(float)x. This is always safe. */
+ case ABS_EXPR:
+ case NEGATE_EXPR:
+ return build1 (TREE_CODE (expr), type,
+ fold (convert_to_real (type,
+ TREE_OPERAND (expr, 0))));
+ /* convert (outertype)((innertype0)a+(innertype1)b)
+ into ((newtype)a+(newtype)b) where newtype
+ is the widest mode from all of these. */
+ case PLUS_EXPR:
+ case MINUS_EXPR:
+ case MULT_EXPR:
+ case RDIV_EXPR:
+ {
+ tree arg0 = strip_float_extensions (TREE_OPERAND (expr, 0));
+ tree arg1 = strip_float_extensions (TREE_OPERAND (expr, 1));
+
+ if (FLOAT_TYPE_P (TREE_TYPE (arg0))
+ && FLOAT_TYPE_P (TREE_TYPE (arg1)))
+ {
+ tree newtype = type;
+ if (TYPE_PRECISION (TREE_TYPE (arg0)) > TYPE_PRECISION (newtype))
+ newtype = TREE_TYPE (arg0);
+ if (TYPE_PRECISION (TREE_TYPE (arg1)) > TYPE_PRECISION (newtype))
+ newtype = TREE_TYPE (arg1);
+ if (TYPE_PRECISION (newtype) < TYPE_PRECISION (itype))
+ {
+ expr = build (TREE_CODE (expr), newtype,
+ fold (convert_to_real (newtype, arg0)),
+ fold (convert_to_real (newtype, arg1)));
+ if (newtype == type)
+ return expr;
+ }
+ }
+ }
+ break;
+ default:
+ break;
+ }
+
switch (TREE_CODE (TREE_TYPE (expr)))
{
case REAL_TYPE:
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
new file mode 100644
index 00000000000..d381c281983
--- /dev/null
+++ b/gcc/coretypes.h
@@ -0,0 +1,59 @@
+/* GCC core type declarations.
+ Copyright (C) 2002 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. */
+
+/* Provide forward declarations of core types which are referred to by
+ most of the compiler. This allows header files to use these types
+ (e.g. in function prototypes) without concern for whether the full
+ definitions are visible. Some other declarations that need to be
+ universally visible are here, too.
+
+ In the context of tconfig.h, most of these have special definitions
+ which prevent them from being used except in further type
+ declarations. This is a kludge; the right thing is to avoid
+ including the "tm.h" header set in the context of tconfig.h, but
+ we're not there yet. */
+
+#ifndef GCC_CORETYPES_H
+#define GCC_CORETYPES_H
+
+#define GTY(x) /* nothing - marker for gengtype */
+
+#ifndef USED_FOR_TARGET
+
+struct rtx_def;
+typedef struct rtx_def *rtx;
+struct rtvec_def;
+typedef struct rtvec_def *rtvec;
+union tree_node;
+typedef union tree_node *tree;
+
+#else
+
+struct _dont_use_rtx_here_;
+struct _dont_use_rtvec_here_;
+union _dont_use_tree_here_;
+#define rtx struct _dont_use_rtx_here_ *
+#define rtvec struct _dont_use_rtvec_here *
+#define tree union _dont_use_tree_here_ *
+
+#endif
+
+#endif /* coretypes.h */
+
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 096b906a633..ceafa26e3a7 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,13 @@
+2002-12-14 Jason Merrill <jason@redhat.com>
+
+ * semantics.c (simplify_aggr_init_exprs_r): Also prepend the
+ return slot for normal functions. Set CALL_EXPR_HAS_RETURN_SLOT_ADDR.
+ * tree.c (build_cplus_new): If the type isn't TREE_ADDRESSABLE,
+ don't bother with an AGGR_INIT_EXPR.
+ (cp_copy_res_decl_for_inlining): If the type isn't TREE_ADDRESSABLE,
+ just generate a new decl normally. Take return slot parm.
+ * cp-tree.h: Adjust prototype.
+
2002-12-13 Gabriel Dos Reis <gdr@integrable-solutions.net>
PR C++/8031
@@ -9,6 +19,13 @@
* cp-tree.h: Have the multiple-include guards around
the entire file.
+2002-12-10 David Edelsohn <edelsohn@gnu.org>
+
+ * cp/spew.c (feed_input): Change limit to last_pos and pos to cur_pos
+ for SPEW_DEBUG.
+ (snarf_method): Same.
+ (snarf_defarg): Same.
+
2002-12-10 Mark Mitchell <mark@codesourcery.com>
PR c++/8372
@@ -42,6 +59,37 @@
* error.c (dump_expr): Don't ever try to dump a non-existent
expression.
+2002-12-03 Nathan Sidwell <nathan@codesourcery.com>
+
+ Implement covariant returns.
+ * cp-tree.h (IS_AGGR_TYPE_2): Remove.
+ (struct lang_decl_flags): Add this_thunk_p flag.
+ Rename vcall_offset to virtual_offset.
+ (struct lang_decl): Rename delta to fixed_offset.
+ (DECL_THIS_THUNK_P, DECL_RESULT_THUNK_P): New #defines.
+ (SET_DECL_THUNK_P): Add THIS_ADJUSTING arg.
+ (THUNK_DELTA, THUNK_VCALL_OFFSET): Rename to ...
+ (THUNK_FIXED_OFFSET, THUNK_VIRTUAL_OFFSET): ... here.
+ (make_thunk): Add this_adjusting arg.
+ (finish_thunk): Declare.
+ (mangle_thunk): Add this_adjusting arg.
+ * class.c (get_vcall_index): Use base function for lookup.
+ (update_vtable_entry_for_fn): Generate covariant thunk.
+ (finish_struct_1): Set DECL_VINDEX to NULL for thunks.
+ (build_vtbl_initializer): Use base function for lookup.
+ Finish covariant thunk here. Adjust thunk generation.
+ * dump.c (cp_dump_tree): Simplify DECL_GLOBAL_[CD]TOR_P handling.
+ Adjust thunk dumping.
+ * mangle.c (mangle_call_offset): New function.
+ (mangle_thunk): Adjust for covariant thunks.
+ * method.c (make_thunk): Adjust. Do not set name here.
+ (finish_thunk): New function. Set name here.
+ (use_thunk): Generate covariant thunks too.
+ (thunk_adjust): New function.
+ * search.c (covariant_return_p): Remove. Fold into ...
+ (check_final_overrider): ... here. Simplify.
+ * semantics.c (emit_associated_thunks): Walk covariant thunk lists.
+
2002-12-03 Jason Merrill <jason@redhat.com>
PR c++/8674
@@ -104,6 +152,15 @@
* decl2.c (coerce_new_type): Likewise.
* except.c (do_allocate_exception): Likewise.
+2002-11-30 Zack Weinberg <zack@codesourcery.com>
+
+ * call.c, class.c, cp-lang.c, cvt.c, cxxfilt.c, decl.c, decl2.c,
+ dump.c, error.c, except.c, expr.c, friend.c, g++spec.c, init.c,
+ lex.c, mangle.c, method.c, optimize.c, parse.y, pt.c, ptree.c,
+ repo.c, rtti.c, search.c, semantics.c, spew.c, tree.c, typeck.c,
+ typeck2.c: Include coretypes.h and tm.h.
+ * Make-lang.in: Update dependencies.
+
2002-11-30 Mark Mitchell <mark@codesourcery.com>
PR c++/8227
@@ -150,6 +207,11 @@
(template_parms_equal): Remove prototype.
* typeck.c (buuld_indirect_ref): Reformat.
+2002-11-25 Jason Merrill <jason@redhat.com>
+
+ * init.c (build_vec_init): Use a FOR_STMT instead of an IF_STMT
+ and a DO_STMT.
+
2002-11-25 Mark Mitchell <mark@codesourcery.com>
* tree.c (cp_build_qualified_type_real): Correct handling of
@@ -171,6 +233,27 @@
* rtti.c (qualifier_flags): Fix thinko.
+2002-11-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ Remove traditional C constructs 1/n.
+ * cp-tree.h (init_method, set_mangled_name_for_decl,
+ build_opfncall, hack_identifier, make_thunk, use_thunk,
+ synthesize_method, implicitly_declare_fn,
+ skip_artificial_parms_for, optimize_function, calls_setjmp_p,
+ maybe_clone_body): Remove use of PARAMS.
+
+ * method.c (do_build_assign_ref, do_build_copy_constructor,
+ synthesize_exception_spec, locate_dtor, locate_ctor, locate_copy):
+ Likewise.
+ (synthesize_method): Use 'bool' type and constants instead of
+ 'int'.
+ (locate_copy): Likewise.
+ (implicitly_declare_fn): Likewise.
+
+ * optimize.c (calls_setjmp_r, update_cloned_parm, dump_function):
+ Remove old-style declaration.
+ (maybe_clone_body): Use 'bool' type and constants.
+
2002-11-21 Glen Nakamura <glen@imodulo.com>
PR c++/8342
@@ -1030,6 +1113,14 @@
* decl.c (start_cleanup_fn): Clear interface_only before
start_function, restore it afterwards.
+2002-09-02 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h (finish_builtin_type): Remove.
+ * decl2.c (finish_builtin_type): Move to common code.
+ * decl.c (build_ptrmemfunc_type): Adjust.
+ * rtti.c (create_pseudo_type_info): Adjust.
+ (create_tinfo_types): Adjust.
+
2002-08-31 Jason Merrill <jason@redhat.com>
* cp-lang.c (cp_expr_size): Allow initialization from a
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index 42656e7933d..6c7a6753165 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -57,7 +57,7 @@ C++ c++: cc1plus$(exeext)
# Tell GNU make to ignore these if they exist.
.PHONY: C++ c++
-g++spec.o: $(srcdir)/cp/g++spec.c $(SYSTEM_H) $(GCC_H) $(CONFIG_H)
+g++spec.o: $(srcdir)/cp/g++spec.c $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) $(CONFIG_H)
(SHLIB_LINK='$(SHLIB_LINK)' \
SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \
@@ -219,60 +219,60 @@ c++.stage4: stage4-start
#
# .o: .h dependencies.
CXX_TREE_H = $(TREE_H) cp/cp-tree.h c-common.h cp/cp-tree.def c-common.def \
- function.h varray.h $(SYSTEM_H) $(CONFIG_H) $(TARGET_H) \
+ function.h varray.h $(SYSTEM_H) coretypes.h $(CONFIG_H) $(TARGET_H) \
$(srcdir)/../include/hashtab.h $(srcdir)/../include/splay-tree.h
-cp/spew.o: cp/spew.c $(CXX_TREE_H) $(srcdir)/cp/parse.h flags.h cp/lex.h \
+cp/spew.o: cp/spew.c $(CXX_TREE_H) $(TM_H) $(srcdir)/cp/parse.h flags.h cp/lex.h \
toplev.h gt-cp-spew.h
-cp/lex.o: cp/lex.c $(CXX_TREE_H) $(srcdir)/cp/parse.h flags.h cp/lex.h \
+cp/lex.o: cp/lex.c $(CXX_TREE_H) $(TM_H) $(srcdir)/cp/parse.h flags.h cp/lex.h \
c-pragma.h toplev.h output.h mbchar.h $(GGC_H) input.h diagnostic.h \
cp/operators.def $(TM_P_H)
-cp/cp-lang.o: cp/cp-lang.c $(CXX_TREE_H) toplev.h langhooks.h $(LANGHOOKS_DEF_H) \
- c-common.h
-cp/decl.o: cp/decl.c $(CXX_TREE_H) flags.h cp/lex.h cp/decl.h stack.h \
+cp/cp-lang.o: cp/cp-lang.c $(CXX_TREE_H) $(TM_H) toplev.h langhooks.h \
+ $(LANGHOOKS_DEF_H) c-common.h
+cp/decl.o: cp/decl.c $(CXX_TREE_H) $(TM_H) flags.h cp/lex.h cp/decl.h stack.h \
output.h $(EXPR_H) except.h toplev.h $(HASHTAB_H) $(GGC_H) $(RTL_H) \
cp/operators.def $(TM_P_H) tree-inline.h diagnostic.h c-pragma.h \
debug.h gt-cp-decl.h gtype-cp.h
-cp/decl2.o: cp/decl2.c $(CXX_TREE_H) flags.h cp/lex.h cp/decl.h $(EXPR_H) \
+cp/decl2.o: cp/decl2.c $(CXX_TREE_H) $(TM_H) flags.h cp/lex.h cp/decl.h $(EXPR_H) \
output.h except.h toplev.h $(GGC_H) $(RTL_H) c-common.h gt-cp-decl2.h
-cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) flags.h toplev.h output.h $(TM_P_H) \
+cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h output.h $(TM_P_H) \
diagnostic.h
-cp/typeck.o: cp/typeck.c $(CXX_TREE_H) flags.h $(RTL_H) $(EXPR_H) toplev.h \
+cp/typeck.o: cp/typeck.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) $(EXPR_H) toplev.h \
diagnostic.h
-cp/class.o: cp/class.c $(CXX_TREE_H) flags.h toplev.h $(RTL_H) $(TARGET_H)
-cp/call.o: cp/call.c $(CXX_TREE_H) flags.h toplev.h $(RTL_H) $(EXPR_H) \
+cp/class.o: cp/class.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H) $(TARGET_H)
+cp/call.o: cp/call.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H) $(EXPR_H) \
$(GGC_H) diagnostic.h gt-cp-call.h
-cp/friend.o: cp/friend.c $(CXX_TREE_H) flags.h $(RTL_H) toplev.h $(EXPR_H)
-cp/init.o: cp/init.c $(CXX_TREE_H) flags.h $(RTL_H) $(EXPR_H) toplev.h \
+cp/friend.o: cp/friend.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) toplev.h $(EXPR_H)
+cp/init.o: cp/init.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) $(EXPR_H) toplev.h \
$(GGC_H) except.h
-cp/method.o: cp/method.c $(CXX_TREE_H) toplev.h $(GGC_H) $(RTL_H) $(EXPR_H) \
+cp/method.o: cp/method.c $(CXX_TREE_H) $(TM_H) toplev.h $(GGC_H) $(RTL_H) $(EXPR_H) \
$(TM_P_H) $(TARGET_H)
-cp/cvt.o: cp/cvt.c $(CXX_TREE_H) cp/decl.h flags.h toplev.h convert.h
-cp/search.o: cp/search.c $(CXX_TREE_H) stack.h flags.h toplev.h $(RTL_H)
-cp/tree.o: cp/tree.c $(CXX_TREE_H) flags.h toplev.h $(GGC_H) $(RTL_H) \
+cp/cvt.o: cp/cvt.c $(CXX_TREE_H) $(TM_H) cp/decl.h flags.h toplev.h convert.h
+cp/search.o: cp/search.c $(CXX_TREE_H) $(TM_H) stack.h flags.h toplev.h $(RTL_H)
+cp/tree.o: cp/tree.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(GGC_H) $(RTL_H) \
insn-config.h integrate.h tree-inline.h real.h gt-cp-tree.h $(TARGET_H)
-cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(SYSTEM_H)
-cp/rtti.o: cp/rtti.c $(CXX_TREE_H) flags.h toplev.h
-cp/except.o: cp/except.c $(CXX_TREE_H) flags.h $(RTL_H) except.h toplev.h \
+cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(TM_H)
+cp/rtti.o: cp/rtti.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h
+cp/except.o: cp/except.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) except.h toplev.h \
cp/cfns.h $(EXPR_H) libfuncs.h tree-inline.h
-cp/expr.o: cp/expr.c $(CXX_TREE_H) $(RTL_H) flags.h $(EXPR_H) toplev.h \
+cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(RTL_H) flags.h $(EXPR_H) toplev.h \
except.h $(TM_P_H)
-cp/pt.o: cp/pt.c $(CXX_TREE_H) cp/decl.h $(srcdir)/cp/parse.h cp/lex.h \
+cp/pt.o: cp/pt.c $(CXX_TREE_H) $(TM_H) cp/decl.h $(srcdir)/cp/parse.h cp/lex.h \
toplev.h $(GGC_H) $(RTL_H) except.h tree-inline.h gt-cp-pt.h
-cp/error.o: cp/error.c $(CXX_TREE_H) toplev.h diagnostic.h flags.h real.h \
+cp/error.o: cp/error.c $(CXX_TREE_H) $(TM_H) toplev.h diagnostic.h flags.h real.h \
$(LANGHOOKS_DEF_H)
-cp/repo.o: cp/repo.c $(CXX_TREE_H) toplev.h $(GGC_H) diagnostic.h \
+cp/repo.o: cp/repo.c $(CXX_TREE_H) $(TM_H) toplev.h $(GGC_H) diagnostic.h \
gt-cp-repo.h
-cp/semantics.o: cp/semantics.c $(CXX_TREE_H) cp/lex.h except.h toplev.h \
+cp/semantics.o: cp/semantics.c $(CXX_TREE_H) $(TM_H) cp/lex.h except.h toplev.h \
flags.h $(GGC_H) debug.h output.h $(RTL_H) $(TIMEVAR_H) $(EXPR_H) \
tree-inline.h
-cp/dump.o: cp/dump.c $(CXX_TREE_H) tree-dump.h
-cp/optimize.o: cp/optimize.c $(CXX_TREE_H) rtl.h integrate.h insn-config.h \
+cp/dump.o: cp/dump.c $(CXX_TREE_H) $(TM_H) tree-dump.h
+cp/optimize.o: cp/optimize.c $(CXX_TREE_H) $(TM_H) rtl.h integrate.h insn-config.h \
input.h $(PARAMS_H) debug.h tree-inline.h
-cp/mangle.o: cp/mangle.c $(CXX_TREE_H) toplev.h real.h
+cp/mangle.o: cp/mangle.c $(CXX_TREE_H) $(TM_H) toplev.h real.h
-cp/parse.o: cp/parse.c $(CXX_TREE_H) flags.h cp/lex.h except.h output.h \
- cp/decl.h $(SYSTEM_H) toplev.h $(GGC_H) gt-cp-parse.h
+cp/parse.o: cp/parse.c $(CXX_TREE_H) $(TM_H) flags.h cp/lex.h except.h output.h \
+ cp/decl.h toplev.h $(GGC_H) gt-cp-parse.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
$(srcdir)/cp/parse.c $(OUTPUT_OPTION)
#
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 072fbe64515..f766092f339 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -26,6 +26,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "cp-tree.h"
#include "output.h"
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 06d09681e6f..9f95c994703 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -25,6 +25,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "cp-tree.h"
#include "flags.h"
@@ -2326,6 +2328,9 @@ get_vcall_index (tree fn, tree type)
{
tree v;
+ if (DECL_RESULT_THUNK_P (fn))
+ fn = TREE_OPERAND (DECL_INITIAL (fn), 0);
+
for (v = CLASSTYPE_VCALL_INDICES (type); v; v = TREE_CHAIN (v))
if ((DECL_DESTRUCTOR_P (fn) && DECL_DESTRUCTOR_P (TREE_PURPOSE (v)))
|| same_signature_p (fn, TREE_PURPOSE (v)))
@@ -2373,10 +2378,53 @@ update_vtable_entry_for_fn (t, binfo, fn, virtuals)
overrider = find_final_overrider (TYPE_BINFO (t), b, fn);
if (overrider == error_mark_node)
return;
+ {
+ /* Check for adjusting covariant return types. */
+ tree over_return = TREE_TYPE (TREE_TYPE (TREE_PURPOSE (overrider)));
+ tree base_return = TREE_TYPE (TREE_TYPE (fn));
+
+ if (POINTER_TYPE_P (over_return)
+ && TREE_CODE (over_return) == TREE_CODE (base_return)
+ && CLASS_TYPE_P (TREE_TYPE (over_return))
+ && CLASS_TYPE_P (TREE_TYPE (base_return)))
+ {
+ tree binfo;
+ base_kind kind;
+
+ binfo = lookup_base (TREE_TYPE (over_return), TREE_TYPE (base_return),
+ ba_check | ba_quiet, &kind);
- /* Check for unsupported covariant returns again now that we've
- calculated the base offsets. */
- check_final_overrider (TREE_PURPOSE (overrider), fn);
+ if (binfo && (kind == bk_via_virtual || !BINFO_OFFSET_ZEROP (binfo)))
+ {
+ tree fixed_offset = BINFO_OFFSET (binfo);
+ tree virtual_offset = NULL_TREE;
+ tree thunk;
+
+ if (kind == bk_via_virtual)
+ {
+ while (!TREE_VIA_VIRTUAL (binfo))
+ binfo = BINFO_INHERITANCE_CHAIN (binfo);
+
+ /* If the covariant type is within the class hierarchy
+ we are currently laying out, the vbase index is not
+ yet known, so we have to remember the virtual base
+ binfo for the moment. The thunk will be finished
+ in build_vtbl_initializer, where we'll know the
+ vtable index of the virtual base. */
+ virtual_offset = binfo_for_vbase (BINFO_TYPE (binfo), t);
+ }
+
+ /* Replace the overriding function with a covariant thunk.
+ We will emit the overriding function in its own slot
+ as well. */
+ thunk = make_thunk (TREE_PURPOSE (overrider), /*this_adjusting=*/0,
+ fixed_offset, virtual_offset);
+ TREE_PURPOSE (overrider) = thunk;
+ if (!virtual_offset && !DECL_NAME (thunk))
+ finish_thunk (thunk, fixed_offset, NULL_TREE);
+ }
+ }
+ }
/* Assume that we will produce a thunk that convert all the way to
the final overrider, and not to an intermediate virtual base. */
@@ -5261,8 +5309,17 @@ finish_struct_1 (t)
fn = TREE_CHAIN (fn),
vindex += (TARGET_VTABLE_USES_DESCRIPTORS
? TARGET_VTABLE_USES_DESCRIPTORS : 1))
- if (TREE_CODE (DECL_VINDEX (BV_FN (fn))) != INTEGER_CST)
- DECL_VINDEX (BV_FN (fn)) = build_shared_int_cst (vindex);
+ {
+ tree fndecl = BV_FN (fn);
+
+ if (DECL_THUNK_P (fndecl))
+ /* A thunk. We should never be calling this entry directly
+ from this vtable -- we'd use the entry for the non
+ thunk base function. */
+ DECL_VINDEX (fndecl) = NULL_TREE;
+ else if (TREE_CODE (DECL_VINDEX (fndecl)) != INTEGER_CST)
+ DECL_VINDEX (fndecl) = build_shared_int_cst (vindex);
+ }
/* Add this class to the list of dynamic classes. */
dynamic_classes = tree_cons (NULL_TREE, t, dynamic_classes);
@@ -7684,11 +7741,24 @@ build_vtbl_initializer (binfo, orig_binfo, t, rtti_binfo, non_fn_entries_p)
{
tree delta;
tree vcall_index;
- tree fn;
+ tree fn, fn_original;
tree init = NULL_TREE;
fn = BV_FN (v);
-
+ fn_original = (DECL_RESULT_THUNK_P (fn)
+ ? TREE_OPERAND (DECL_INITIAL (fn), 0)
+ : fn);
+ /* Finish an unfinished covariant thunk. */
+ if (DECL_RESULT_THUNK_P (fn) && !DECL_NAME (fn))
+ {
+ tree binfo = THUNK_VIRTUAL_OFFSET (fn);
+ tree fixed_offset = size_int (THUNK_FIXED_OFFSET (fn));
+ tree virtual_offset = BINFO_VPTR_FIELD (binfo);
+
+ fixed_offset = size_diffop (fixed_offset, BINFO_OFFSET (binfo));
+ finish_thunk (fn, fixed_offset, virtual_offset);
+ }
+
/* If the only definition of this function signature along our
primary base chain is from a lost primary, this vtable slot will
never be used, so just zero it out. This is important to avoid
@@ -7702,7 +7772,7 @@ build_vtbl_initializer (binfo, orig_binfo, t, rtti_binfo, non_fn_entries_p)
for (b = binfo; ; b = get_primary_binfo (b))
{
/* We found a defn before a lost primary; go ahead as normal. */
- if (look_for_overrides_here (BINFO_TYPE (b), fn))
+ if (look_for_overrides_here (BINFO_TYPE (b), fn_original))
break;
/* The nearest definition is from a lost primary; clear the
@@ -7726,10 +7796,14 @@ build_vtbl_initializer (binfo, orig_binfo, t, rtti_binfo, non_fn_entries_p)
/* You can't call an abstract virtual function; it's abstract.
So, we replace these functions with __pure_virtual. */
- if (DECL_PURE_VIRTUAL_P (fn))
+ if (DECL_PURE_VIRTUAL_P (fn_original))
fn = abort_fndecl;
else if (!integer_zerop (delta) || vcall_index)
- fn = make_thunk (fn, delta, vcall_index);
+ {
+ fn = make_thunk (fn, /*this_adjusting=*/1, delta, vcall_index);
+ if (!DECL_NAME (fn))
+ finish_thunk (fn, delta, THUNK_VIRTUAL_OFFSET (fn));
+ }
/* Take the address of the function, considering it to be of an
appropriate generic type. */
init = build1 (ADDR_EXPR, vfunc_ptr_type_node, fn);
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index a7f2d85966e..42b2da0c130 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "cp-tree.h"
#include "c-common.h"
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 3b50ffec48a..9176eba7d49 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1001,9 +1001,6 @@ enum languages { lang_c, lang_cplusplus, lang_java };
(IS_AGGR_TYPE_CODE (TREE_CODE (T)) && IS_AGGR_TYPE (T))
#define IS_AGGR_TYPE_CODE(T) ((T) == RECORD_TYPE || (T) == UNION_TYPE)
-#define IS_AGGR_TYPE_2(TYPE1, TYPE2) \
- (TREE_CODE (TYPE1) == TREE_CODE (TYPE2) \
- && IS_AGGR_TYPE (TYPE1) && IS_AGGR_TYPE (TYPE2))
#define TAGGED_TYPE_P(T) \
(CLASS_TYPE_P (T) || TREE_CODE (T) == ENUMERAL_TYPE)
#define IS_OVERLOAD_TYPE(T) TAGGED_TYPE_P (T)
@@ -1741,7 +1738,7 @@ struct lang_decl_flags GTY(())
unsigned u1sel : 1;
unsigned u2sel : 1;
unsigned can_be_full : 1;
- unsigned unused : 1; /* One unused bit. */
+ unsigned this_thunk_p : 1;
union lang_decl_u {
/* In a FUNCTION_DECL, VAR_DECL, TYPE_DECL, or TEMPLATE_DECL, this
@@ -1760,8 +1757,8 @@ struct lang_decl_flags GTY(())
int discriminator;
/* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is
- THUNK_VCALL_OFFSET. */
- tree GTY((tag ("2"))) vcall_offset;
+ THUNK_VIRTUAL_OFFSET. */
+ tree GTY((tag ("2"))) virtual_offset;
} GTY ((desc ("%1.u2sel"))) u2;
};
@@ -1777,15 +1774,18 @@ struct lang_decl GTY(())
/* For a non-virtual FUNCTION_DECL, this is
DECL_FRIEND_CONTEXT. For a virtual FUNCTION_DECL for which
- DECL_THUNK_P does not hold, this is DECL_THUNKS. */
+ DECL_THIS_THUNK_P does not hold, this is DECL_THUNKS. Both
+ this pointer and result pointer adjusting thunks are
+ chained here. This pointer thunks to return pointer thunks
+ will be chained on the return pointer thunk. */
tree context;
/* In a FUNCTION_DECL, this is DECL_CLONED_FUNCTION. */
tree cloned_function;
/* In a FUNCTION_DECL for which THUNK_P holds, this is
- THUNK_DELTA. */
- HOST_WIDE_INT delta;
+ THUNK_FIXED_OFFSET. */
+ HOST_WIDE_INT fixed_offset;
/* In an overloaded operator, this is the value of
DECL_OVERLOADED_OPERATOR_P. */
@@ -2067,8 +2067,7 @@ struct lang_decl GTY(())
#define DECL_NEEDS_FINAL_OVERRIDER_P(NODE) \
(DECL_LANG_SPECIFIC (NODE)->decl_flags.needs_final_overrider)
-/* The thunks associated with NODE, a FUNCTION_DECL that is not itself
- a thunk. */
+/* The thunks associated with NODE, a FUNCTION_DECL. */
#define DECL_THUNKS(NODE) \
(DECL_LANG_SPECIFIC (NODE)->u.f.context)
@@ -2077,6 +2076,14 @@ struct lang_decl GTY(())
(TREE_CODE (NODE) == FUNCTION_DECL \
&& DECL_LANG_FLAG_7 (NODE))
+/* Nonzero if NODE is a this pointer adjusting thunk. */
+#define DECL_THIS_THUNK_P(NODE) \
+ (DECL_THUNK_P (NODE) && DECL_LANG_SPECIFIC (NODE)->decl_flags.this_thunk_p)
+
+/* Nonzero if NODE is a result pointer adjusting thunk. */
+#define DECL_RESULT_THUNK_P(NODE) \
+ (DECL_THUNK_P (NODE) && !DECL_LANG_SPECIFIC (NODE)->decl_flags.this_thunk_p)
+
/* Nonzero if NODE is a FUNCTION_DECL, but not a thunk. */
#define DECL_NON_THUNK_FUNCTION_P(NODE) \
(TREE_CODE (NODE) == FUNCTION_DECL && !DECL_THUNK_P (NODE))
@@ -2090,9 +2097,10 @@ struct lang_decl GTY(())
(DECL_NON_THUNK_FUNCTION_P (NODE) && DECL_EXTERN_C_P (NODE))
/* Set DECL_THUNK_P for node. */
-#define SET_DECL_THUNK_P(NODE) \
+#define SET_DECL_THUNK_P(NODE, THIS_ADJUSTING) \
(DECL_LANG_FLAG_7 (NODE) = 1, \
- DECL_LANG_SPECIFIC (NODE)->u.f.u3sel = 1)
+ DECL_LANG_SPECIFIC (NODE)->u.f.u3sel = 1, \
+ DECL_LANG_SPECIFIC (NODE)->decl_flags.this_thunk_p = (THIS_ADJUSTING))
/* Nonzero if this DECL is the __PRETTY_FUNCTION__ variable in a
template function. */
@@ -2922,33 +2930,42 @@ struct lang_decl GTY(())
A thunk is an alternate entry point for an ordinary FUNCTION_DECL.
The address of the ordinary FUNCTION_DECL is given by the
DECL_INITIAL, which is always an ADDR_EXPR whose operand is a
- FUNCTION_DECL. The job of the thunk is to adjust the `this'
- pointer before transferring control to the FUNCTION_DECL.
-
+ FUNCTION_DECL. The job of the thunk is to either adjust the this
+ pointer before transferring control to the FUNCTION_DECL, or call
+ FUNCTION_DECL and then adjust the result value. Note, the result
+ pointer adjusting thunk must perform a call to the thunked
+ function, (or be implemented via passing some invisible parameter
+ to the thunked function, which is modified to perform the
+ adjustment just before returning).
+
A thunk may perform either, or both, of the following operations:
- o Adjust the `this' pointer by a constant offset.
- o Adjust the `this' pointer by looking up a vcall-offset
+ o Adjust the this or result pointer by a constant offset.
+ o Adjust the this or result pointer by looking up a vcall or vbase offset
in the vtable.
- If both operations are performed, then the constant adjument to
- `this' is performed first.
+ A this pointer adjusting thunk converts from a base to a derived
+ class, and hence adds the offsets. A result pointer adjusting thunk
+ converts from a derived class to a base, and hence subtracts the
+ offsets. If both operations are performed, then the constant
+ adjument is performed first for this pointer adjustment and last
+ for the result pointer adjustment.
- The constant adjustment is given by THUNK_DELTA. If the
- vcall-offset is required, the index into the vtable is given by
- THUNK_VCALL_OFFSET. */
+ 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. */
/* An integer indicating how many bytes should be subtracted from the
- `this' pointer when this function is called. */
-#define THUNK_DELTA(DECL) \
- (DECL_LANG_SPECIFIC (DECL)->u.f.delta)
+ this or result pointer when this function is called. */
+#define THUNK_FIXED_OFFSET(DECL) \
+ (DECL_LANG_SPECIFIC (DECL)->u.f.fixed_offset)
-/* A tree indicating how many bytes should be subtracted from the
- vtable for the `this' pointer to find the vcall offset. (The vptr
- is always located at offset zero from the f `this' pointer.) If
- NULL, then there is no vcall offset. */
-#define THUNK_VCALL_OFFSET(DECL) \
- (LANG_DECL_U2_CHECK (DECL, 0)->vcall_offset)
+/* A tree indicating how many bytes should be added to the
+ vtable for the this or result pointer to find the vcall or vbase
+ offset. (The vptr is always located at offset zero from the
+ this or result pointer.) If NULL, then there is no virtual adjust. */
+#define THUNK_VIRTUAL_OFFSET(DECL) \
+ (LANG_DECL_U2_CHECK (DECL, 0)->virtual_offset)
/* These macros provide convenient access to the various _STMT nodes
created when parsing template declarations. */
@@ -3795,8 +3812,6 @@ extern bool constructor_name_p (tree, tree);
extern void defer_fn PARAMS ((tree));
extern void finish_anon_union PARAMS ((tree));
extern tree finish_table PARAMS ((tree, tree, tree, int));
-extern void finish_builtin_type PARAMS ((tree, const char *,
- tree *, int, tree));
extern tree coerce_new_type PARAMS ((tree));
extern tree coerce_delete_type PARAMS ((tree));
extern void comdat_linkage PARAMS ((tree));
@@ -3947,20 +3962,21 @@ extern void cxx_finish PARAMS ((void));
extern void cxx_init_options PARAMS ((void));
/* in method.c */
-extern void init_method PARAMS ((void));
-extern void set_mangled_name_for_decl PARAMS ((tree));
-extern tree build_opfncall PARAMS ((enum tree_code, int, tree, tree, tree));
-extern tree hack_identifier PARAMS ((tree, tree));
-extern tree make_thunk PARAMS ((tree, tree, tree));
-extern void use_thunk PARAMS ((tree, int));
-extern void synthesize_method PARAMS ((tree));
-extern tree implicitly_declare_fn PARAMS ((special_function_kind, tree, int));
-extern tree skip_artificial_parms_for PARAMS ((tree, tree));
+extern void init_method (void);
+extern void set_mangled_name_for_decl (tree);
+extern tree build_opfncall (enum tree_code, int, tree, tree, tree);
+extern tree hack_identifier (tree, tree);
+extern tree make_thunk (tree, bool, tree, tree);
+extern void finish_thunk (tree, tree, tree);
+extern void use_thunk (tree, bool);
+extern void synthesize_method (tree);
+extern tree implicitly_declare_fn (special_function_kind, tree, bool);
+extern tree skip_artificial_parms_for (tree, tree);
/* In optimize.c */
-extern void optimize_function PARAMS ((tree));
-extern int calls_setjmp_p PARAMS ((tree));
-extern int maybe_clone_body PARAMS ((tree));
+extern void optimize_function (tree);
+extern bool calls_setjmp_p (tree);
+extern bool maybe_clone_body (tree);
/* in pt.c */
extern void check_template_shadow PARAMS ((tree));
@@ -4282,7 +4298,7 @@ extern tree cp_add_pending_fn_decls PARAMS ((void*,tree));
extern int cp_is_overload_p PARAMS ((tree));
extern int cp_auto_var_in_fn_p PARAMS ((tree,tree));
extern tree cp_copy_res_decl_for_inlining PARAMS ((tree, tree, tree, void*,
- int*, void*));
+ int*, tree));
extern int cp_start_inlining PARAMS ((tree));
extern void cp_end_inlining PARAMS ((tree));
@@ -4385,7 +4401,7 @@ extern tree mangle_typeinfo_string_for_type PARAMS ((tree));
extern tree mangle_vtbl_for_type PARAMS ((tree));
extern tree mangle_vtt_for_type PARAMS ((tree));
extern tree mangle_ctor_vtbl_for_type PARAMS ((tree, tree));
-extern tree mangle_thunk PARAMS ((tree, tree, tree));
+extern tree mangle_thunk PARAMS ((tree, int, tree, tree));
extern tree mangle_conv_op_name_for_type PARAMS ((tree));
extern tree mangle_guard_variable PARAMS ((tree));
extern tree mangle_ref_init_variable PARAMS ((tree));
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 97d24202850..2443505bd8f 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -28,6 +28,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "flags.h"
#include "cp-tree.h"
diff --git a/gcc/cp/cxxfilt.c b/gcc/cp/cxxfilt.c
new file mode 100644
index 00000000000..42da31559a1
--- /dev/null
+++ b/gcc/cp/cxxfilt.c
@@ -0,0 +1,304 @@
+/* Demangler for GNU C++ - main program
+ Copyright 1989, 1991, 1994, 1995, 1996, 1997, 1998, 1999,
+ 2000, 2001, 2002 Free Software Foundation, Inc.
+ Written by James Clark (jjc@jclark.uucp)
+ Rewritten by Fred Fish (fnf@cygnus.com) for ARM and Lucid demangling
+ Modified by Satish Pai (pai@apollo.hp.com) for HP demangling
+
+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. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "demangle.h"
+#include "getopt.h"
+#include "version.h"
+
+static const char *program_name;
+static int flags = DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE;
+
+static void demangle_it PARAMS ((char *));
+static void usage PARAMS ((FILE *, int)) ATTRIBUTE_NORETURN;
+static void fatal PARAMS ((const char *)) ATTRIBUTE_NORETURN;
+static void print_demangler_list PARAMS ((FILE *));
+
+static void
+demangle_it (mangled_name)
+ char *mangled_name;
+{
+ char *result;
+
+ /* For command line args, also try to demangle type encodings. */
+ result = cplus_demangle (mangled_name, flags | DMGL_TYPES);
+ if (result == NULL)
+ {
+ printf ("%s\n", mangled_name);
+ }
+ else
+ {
+ printf ("%s\n", result);
+ free (result);
+ }
+}
+
+static void
+print_demangler_list (stream)
+ FILE *stream;
+{
+ const struct demangler_engine *demangler;
+
+ fprintf (stream, "{%s", libiberty_demanglers->demangling_style_name);
+
+ for (demangler = libiberty_demanglers + 1;
+ demangler->demangling_style != unknown_demangling;
+ ++demangler)
+ fprintf (stream, ",%s", demangler->demangling_style_name);
+
+ fprintf (stream, "}");
+}
+
+static void
+usage (stream, status)
+ FILE *stream;
+ int status;
+{
+ fprintf (stream, "\
+Usage: %s [-_] [-n] [--strip-underscores] [--no-strip-underscores] \n",
+ program_name);
+
+ fprintf (stream, "\
+ [-s ");
+ print_demangler_list (stream);
+ fprintf (stream, "]\n");
+
+ fprintf (stream, "\
+ [--format ");
+ print_demangler_list (stream);
+ fprintf (stream, "]\n");
+
+ fprintf (stream, "\
+ [--help] [--version] [arg...]\n");
+ exit (status);
+}
+
+#define MBUF_SIZE 32767
+char mbuffer[MBUF_SIZE];
+
+int strip_underscore = 0;
+
+static const struct option long_options[] = {
+ {"strip-underscores", no_argument, 0, '_'},
+ {"format", required_argument, 0, 's'},
+ {"help", no_argument, 0, 'h'},
+ {"no-strip-underscores", no_argument, 0, 'n'},
+ {"version", no_argument, 0, 'v'},
+ {0, no_argument, 0, 0}
+};
+
+static const char *
+standard_symbol_characters PARAMS ((void));
+
+static const char *
+hp_symbol_characters PARAMS ((void));
+
+/* Return the string of non-alnum characters that may occur
+ as a valid symbol component, in the standard assembler symbol
+ syntax. */
+
+static const char *
+standard_symbol_characters ()
+{
+ return "_$.";
+}
+
+
+/* Return the string of non-alnum characters that may occur
+ as a valid symbol name component in an HP object file.
+
+ Note that, since HP's compiler generates object code straight from
+ C++ source, without going through an assembler, its mangled
+ identifiers can use all sorts of characters that no assembler would
+ tolerate, so the alphabet this function creates is a little odd.
+ Here are some sample mangled identifiers offered by HP:
+
+ typeid*__XT24AddressIndExpClassMember_
+ [Vftptr]key:__dt__32OrdinaryCompareIndExpClassMemberFv
+ __ct__Q2_9Elf64_Dyn18{unnamed.union.#1}Fv
+
+ This still seems really weird to me, since nowhere else in this
+ file is there anything to recognize curly brackets, parens, etc.
+ I've talked with Srikanth <srikanth@cup.hp.com>, and he assures me
+ this is right, but I still strongly suspect that there's a
+ misunderstanding here.
+
+ If we decide it's better for c++filt to use HP's assembler syntax
+ to scrape identifiers out of its input, here's the definition of
+ the symbol name syntax from the HP assembler manual:
+
+ Symbols are composed of uppercase and lowercase letters, decimal
+ digits, dollar symbol, period (.), ampersand (&), pound sign(#) and
+ underscore (_). A symbol can begin with a letter, digit underscore or
+ dollar sign. If a symbol begins with a digit, it must contain a
+ non-digit character.
+
+ So have fun. */
+static const char *
+hp_symbol_characters ()
+{
+ return "_$.<>#,*&[]:(){}";
+}
+
+extern int main PARAMS ((int, char **));
+
+int
+main (argc, argv)
+ int argc;
+ char **argv;
+{
+ char *result;
+ int c;
+ const char *valid_symbols;
+ enum demangling_styles style = auto_demangling;
+
+ program_name = argv[0];
+
+ strip_underscore = (USER_LABEL_PREFIX[0] == '_');
+
+ while ((c = getopt_long (argc, argv, "_ns:", long_options, (int *) 0)) != EOF)
+ {
+ switch (c)
+ {
+ case '?':
+ usage (stderr, 1);
+ break;
+ case 'h':
+ usage (stdout, 0);
+ case 'n':
+ strip_underscore = 0;
+ break;
+ case 'v':
+ printf ("GNU %s (C++ demangler), version %s\n",
+ program_name, version_string);
+ return (0);
+ case '_':
+ strip_underscore = 1;
+ break;
+ case 's':
+ {
+ style = cplus_demangle_name_to_style (optarg);
+ if (style == unknown_demangling)
+ {
+ fprintf (stderr, "%s: unknown demangling style `%s'\n",
+ program_name, optarg);
+ return (1);
+ }
+ else
+ cplus_demangle_set_style (style);
+ }
+ break;
+ }
+ }
+
+ if (optind < argc)
+ {
+ for ( ; optind < argc; optind++)
+ {
+ demangle_it (argv[optind]);
+ }
+ }
+ else
+ {
+ switch (current_demangling_style)
+ {
+ case gnu_demangling:
+ case lucid_demangling:
+ case arm_demangling:
+ case java_demangling:
+ case edg_demangling:
+ case gnat_demangling:
+ case gnu_v3_demangling:
+ case auto_demangling:
+ valid_symbols = standard_symbol_characters ();
+ break;
+ case hp_demangling:
+ valid_symbols = hp_symbol_characters ();
+ break;
+ default:
+ /* Folks should explicitly indicate the appropriate alphabet for
+ each demangling. Providing a default would allow the
+ question to go unconsidered. */
+ fatal ("Internal error: no symbol alphabet for current style");
+ }
+
+ for (;;)
+ {
+ int i = 0;
+ c = getchar ();
+ /* Try to read a label. */
+ while (c != EOF && (ISALNUM (c) || strchr (valid_symbols, c)))
+ {
+ if (i >= MBUF_SIZE-1)
+ break;
+ mbuffer[i++] = c;
+ c = getchar ();
+ }
+ if (i > 0)
+ {
+ int skip_first = 0;
+
+ mbuffer[i] = 0;
+ if (mbuffer[0] == '.' || mbuffer[0] == '$')
+ ++skip_first;
+ if (strip_underscore && mbuffer[skip_first] == '_')
+ ++skip_first;
+
+ if (skip_first > i)
+ skip_first = i;
+
+ flags |= (int) style;
+ result = cplus_demangle (mbuffer + skip_first, flags);
+ if (result)
+ {
+ if (mbuffer[0] == '.')
+ putc ('.', stdout);
+ fputs (result, stdout);
+ free (result);
+ }
+ else
+ fputs (mbuffer, stdout);
+
+ fflush (stdout);
+ }
+ if (c == EOF)
+ break;
+ putchar (c);
+ fflush (stdout);
+ }
+ }
+
+ return (0);
+}
+
+static void
+fatal (str)
+ const char *str;
+{
+ fprintf (stderr, "%s: %s\n", program_name, str);
+ exit (1);
+}
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index e68c06447e1..e3f5b5a9f29 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -30,6 +30,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "expr.h"
@@ -9535,7 +9537,7 @@ tree
build_ptrmemfunc_type (type)
tree type;
{
- tree fields[4];
+ tree field, fields;
tree t;
tree unqualified_variant = NULL_TREE;
@@ -9561,10 +9563,14 @@ build_ptrmemfunc_type (type)
/* ... and not really an aggregate. */
SET_IS_AGGR_TYPE (t, 0);
- fields[0] = build_decl (FIELD_DECL, pfn_identifier, type);
- fields[1] = build_decl (FIELD_DECL, delta_identifier,
- delta_type_node);
- finish_builtin_type (t, "__ptrmemfunc_type", fields, 1, ptr_type_node);
+ field = build_decl (FIELD_DECL, pfn_identifier, type);
+ fields = field;
+
+ field = build_decl (FIELD_DECL, delta_identifier, delta_type_node);
+ TREE_CHAIN (field) = fields;
+ fields = field;
+
+ finish_builtin_struct (t, "__ptrmemfunc_type", fields, ptr_type_node);
/* Zap out the name so that the back-end will give us the debugging
information for this anonymous RECORD_TYPE. */
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 248fa2d6725..6734301f2df 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -30,6 +30,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "expr.h"
@@ -1415,43 +1417,6 @@ finish_anon_union (anon_union_decl)
add_decl_stmt (anon_union_decl);
}
-
-/* Finish processing a builtin type TYPE. It's name is NAME,
- its fields are in the array FIELDS. LEN is the number of elements
- in FIELDS minus one, or put another way, it is the maximum subscript
- used in FIELDS.
-
- It is given the same alignment as ALIGN_TYPE. */
-
-void
-finish_builtin_type (type, name, fields, len, align_type)
- tree type;
- const char *name;
- tree fields[];
- int len;
- tree align_type;
-{
- register int i;
-
- TYPE_FIELDS (type) = fields[0];
- for (i = 0; i < len; i++)
- {
- layout_type (TREE_TYPE (fields[i]));
- DECL_FIELD_CONTEXT (fields[i]) = type;
- TREE_CHAIN (fields[i]) = fields[i+1];
- }
- DECL_FIELD_CONTEXT (fields[i]) = type;
- TYPE_ALIGN (type) = TYPE_ALIGN (align_type);
- TYPE_USER_ALIGN (type) = TYPE_USER_ALIGN (align_type);
- layout_type (type);
-#if 0 /* not yet, should get fixed properly later */
- TYPE_NAME (type) = make_type_decl (get_identifier (name), type);
-#else
- TYPE_NAME (type) = build_decl (TYPE_DECL, get_identifier (name), type);
-#endif
- TYPE_STUB_DECL (type) = TYPE_NAME (type);
- layout_decl (TYPE_NAME (type), 0);
-}
/* Auxiliary functions to make type signatures for
`operator new' and `operator delete' correspond to
diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c
index c4472b07359..fa55833e208 100644
--- a/gcc/cp/dump.c
+++ b/gcc/cp/dump.c
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "cp-tree.h"
#include "tree-dump.h"
@@ -317,21 +319,22 @@ cp_dump_tree (dump_info, t)
dump_string (di, "destructor");
if (DECL_CONV_FN_P (t))
dump_string (di, "conversion");
- if (DECL_GLOBAL_CTOR_P (t) || DECL_GLOBAL_DTOR_P (t))
- {
- if (DECL_GLOBAL_CTOR_P (t))
- dump_string (di, "global init");
- if (DECL_GLOBAL_DTOR_P (t))
- dump_string (di, "global fini");
- }
+ if (DECL_GLOBAL_CTOR_P (t))
+ dump_string (di, "global init");
+ if (DECL_GLOBAL_DTOR_P (t))
+ dump_string (di, "global fini");
if (DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (t))
dump_string (di, "pseudo tmpl");
}
else
{
dump_string (di, "thunk");
- dump_int (di, "dlta", THUNK_DELTA (t));
- dump_child ("vcll", THUNK_VCALL_OFFSET (t));
+ if (DECL_THIS_THUNK_P (t))
+ dump_string (di, "this adjusting");
+ else
+ dump_string (di, "result adjusting");
+ dump_int (di, "fixd", THUNK_FIXED_OFFSET (t));
+ dump_child ("virt", THUNK_VIRTUAL_OFFSET (t));
dump_child ("fn", DECL_INITIAL (t));
}
break;
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index da880f5fad4..9ede84a7156 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "cp-tree.h"
#include "real.h"
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 747cc1aaef6..753686b1114 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -25,6 +25,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "expr.h"
diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c
index e5b0439c93d..ede1c473677 100644
--- a/gcc/cp/expr.c
+++ b/gcc/cp/expr.c
@@ -23,6 +23,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c
index 7b718ace0df..9e474114312 100644
--- a/gcc/cp/friend.c
+++ b/gcc/cp/friend.c
@@ -20,6 +20,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "expr.h"
diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c
index d46244857b2..2d8e8f429a5 100644
--- a/gcc/cp/g++spec.c
+++ b/gcc/cp/g++spec.c
@@ -20,6 +20,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "gcc.h"
/* This bit is set if we saw a `-xfoo' language specification. */
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 39d4c57047e..bfce5564b4b 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "expr.h"
@@ -2445,7 +2447,10 @@ build_new_1 (exp)
things; in particular, it would make it difficult to bail out
if the allocation function returns null. Er, no, it wouldn't;
we just don't run the constructor. The standard says it's
- unspecified whether or not the args are evaluated. */
+ unspecified whether or not the args are evaluated.
+
+ FIXME FIXME FIXME inline invisible refs as refs. That way we
+ can preevaluate value parameters. */
if (cleanup)
{
@@ -2753,10 +2758,10 @@ build_vec_init (base, init, from_array)
T* rval = t1;
ptrdiff_t iterator = maxindex;
try {
- do {
+ for (; iterator != -1; --iterator) {
... initialize *t1 ...
++t1;
- } while (--iterator != -1);
+ }
} catch (...) {
... destroy elements that were constructed ...
}
@@ -2856,19 +2861,20 @@ build_vec_init (base, init, from_array)
{
/* If the ITERATOR is equal to -1, then we don't have to loop;
we've already initialized all the elements. */
- tree if_stmt;
- tree do_stmt;
- tree do_body;
+ tree for_stmt;
+ tree for_body;
tree elt_init;
- if_stmt = begin_if_stmt ();
- finish_if_stmt_cond (build (NE_EXPR, boolean_type_node,
- iterator, integer_minus_one_node),
- if_stmt);
+ for_stmt = begin_for_stmt ();
+ finish_for_init_stmt (for_stmt);
+ finish_for_cond (build (NE_EXPR, boolean_type_node,
+ iterator, integer_minus_one_node),
+ for_stmt);
+ finish_for_expr (build_unary_op (PREDECREMENT_EXPR, iterator, 0),
+ for_stmt);
/* Otherwise, loop through the elements. */
- do_stmt = begin_do_stmt ();
- do_body = begin_compound_stmt (/*has_no_scope=*/1);
+ for_body = begin_compound_stmt (/*has_no_scope=*/1);
/* When we're not building a statement-tree, things are a little
complicated. If, when we recursively call build_aggr_init,
@@ -2933,15 +2939,8 @@ build_vec_init (base, init, from_array)
if (base2)
finish_expr_stmt (build_unary_op (PREINCREMENT_EXPR, base2, 0));
- finish_compound_stmt (/*has_no_scope=*/1, do_body);
- finish_do_body (do_stmt);
- finish_do_stmt (build (NE_EXPR, boolean_type_node,
- build_unary_op (PREDECREMENT_EXPR, iterator, 0),
- integer_minus_one_node),
- do_stmt);
-
- finish_then_clause (if_stmt);
- finish_if_stmt ();
+ finish_compound_stmt (/*has_no_scope=*/1, for_body);
+ finish_for_stmt (for_stmt);
}
/* Make sure to cleanup any partially constructed elements. */
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 4558940d675..e60ebe8761e 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -25,6 +25,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "input.h"
#include "tree.h"
#include "cp-tree.h"
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 523db85ab38..cf106d518cd 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -49,6 +49,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "cp-tree.h"
#include "real.h"
@@ -154,6 +156,7 @@ static void add_substitution PARAMS ((tree));
static inline int is_std_substitution PARAMS ((tree, substitution_identifier_index_t));
static inline int is_std_substitution_char PARAMS ((tree, substitution_identifier_index_t));
static int find_substitution PARAMS ((tree));
+static void mangle_call_offset PARAMS ((tree, tree));
/* Functions for emitting mangled representations of things. */
@@ -2532,45 +2535,79 @@ mangle_ctor_vtbl_for_type (type, binfo)
return get_identifier (result);
}
-/* Return an identifier for the mangled name of a thunk to FN_DECL.
- OFFSET is the initial adjustment to this used to find the vptr. If
- VCALL_OFFSET is non-NULL, this is a virtual thunk, and it is the
- vtbl offset in bytes.
+/* Mangle a this pointer or result pointer adjustment.
+
+ <call-offset> ::= h <fixed offset number> _
+ ::= v <fixed offset number> _ <virtual offset number> _ */
+
+static void
+mangle_call_offset (fixed_offset, virtual_offset)
+ tree fixed_offset;
+ tree virtual_offset;
+{
+ if (virtual_offset)
+ write_char (virtual_offset ? 'v' : 'h');
+ else
+ write_char ('h');
+
+ /* For either flavor, write the fixed offset. */
+ write_integer_cst (fixed_offset);
+ write_char ('_');
+
+ /* For a virtual thunk, add the virtual offset. */
+ if (virtual_offset)
+ {
+ write_integer_cst (virtual_offset);
+ write_char ('_');
+ }
+}
+
+/* Return an identifier for the mangled name of a this-adjusting or
+ covariant thunk to FN_DECL. FIXED_OFFSET is the initial adjustment
+ to this used to find the vptr. If VIRTUAL_OFFSET is non-NULL, this
+ is a virtual thunk, and it is the vtbl offset in
+ bytes. THIS_ADJUSTING is non-zero for a this adjusting thunk and
+ zero for a covariant thunk. Note, that FN_DECL might be a covariant
+ thunk itself. A covariant thunk name always includes the adjustment
+ for the this pointer, even if there is none.
- <special-name> ::= Th <offset number> _ <base encoding>
- ::= Tv <offset number> _ <vcall offset number> _
- <base encoding>
+ <special-name> ::= T <call-offset> <base encoding>
+ ::= Tc <this_adjust call-offset> <result_adjust call-offset>
+ <base encoding>
*/
tree
-mangle_thunk (fn_decl, offset, vcall_offset)
+mangle_thunk (fn_decl, this_adjusting, fixed_offset, virtual_offset)
tree fn_decl;
- tree offset;
- tree vcall_offset;
+ int this_adjusting;
+ tree fixed_offset;
+ tree virtual_offset;
{
const char *result;
start_mangling (fn_decl);
write_string ("_Z");
- /* The <special-name> for virtual thunks is Tv, for non-virtual
- thunks Th. */
write_char ('T');
- if (vcall_offset != 0)
- write_char ('v');
+
+ if (this_adjusting && !DECL_RESULT_THUNK_P (fn_decl))
+ /* Plain this adjusting thunk. */
+ mangle_call_offset (fixed_offset, virtual_offset);
+ else if (!this_adjusting)
+ {
+ /* Covariant thunk with no this adjustment */
+ write_char ('c');
+ mangle_call_offset (integer_zero_node, NULL_TREE);
+ mangle_call_offset (fixed_offset, virtual_offset);
+ }
else
- write_char ('h');
-
- /* For either flavor, write the offset to this. */
- write_integer_cst (offset);
- write_char ('_');
-
- /* For a virtual thunk, add the vcall offset. */
- if (vcall_offset)
{
- /* Virtual thunk. Write the vcall offset and base type name. */
- write_integer_cst (vcall_offset);
- write_char ('_');
+ /* This adjusting thunk to covariant thunk. */
+ write_char ('c');
+ mangle_call_offset (fixed_offset, virtual_offset);
+ mangle_call_offset (ssize_int (THUNK_FIXED_OFFSET (fn_decl)),
+ THUNK_VIRTUAL_OFFSET (fn_decl));
+ fn_decl = TREE_OPERAND (DECL_INITIAL (fn_decl), 0);
}
/* Scoped name. */
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 8a905b21b75..12a66f6526d 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -25,6 +25,8 @@ Boston, MA 02111-1307, USA. */
/* Handle method declarations. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "cp-tree.h"
#include "rtl.h"
@@ -54,17 +56,18 @@ enum mangling_flags
typedef enum mangling_flags mangling_flags;
-static void do_build_assign_ref PARAMS ((tree));
-static void do_build_copy_constructor PARAMS ((tree));
-static tree synthesize_exception_spec PARAMS ((tree, tree (*) (tree, void *), void *));
-static tree locate_dtor PARAMS ((tree, void *));
-static tree locate_ctor PARAMS ((tree, void *));
-static tree locate_copy PARAMS ((tree, void *));
+static tree thunk_adjust (tree, bool, HOST_WIDE_INT, tree);
+static void do_build_assign_ref (tree);
+static void do_build_copy_constructor (tree);
+static tree synthesize_exception_spec (tree, tree (*) (tree, void *), void *);
+static tree locate_dtor (tree, void *);
+static tree locate_ctor (tree, void *);
+static tree locate_copy (tree, void *);
/* Called once to initialize method.c. */
void
-init_method ()
+init_method (void)
{
init_mangle ();
}
@@ -73,8 +76,7 @@ init_method ()
/* Set the mangled name (DECL_ASSEMBLER_NAME) for DECL. */
void
-set_mangled_name_for_decl (decl)
- tree decl;
+set_mangled_name_for_decl (tree decl)
{
if (processing_template_decl)
/* There's no need to mangle the name of a template function. */
@@ -108,10 +110,8 @@ set_mangled_name_for_decl (decl)
/* NOSTRICT */
tree
-build_opfncall (code, flags, xarg1, xarg2, arg3)
- enum tree_code code;
- int flags;
- tree xarg1, xarg2, arg3;
+build_opfncall (enum tree_code code, int flags,
+ tree xarg1, tree xarg2, tree arg3)
{
return build_new_op (code, flags, xarg1, xarg2, arg3);
}
@@ -136,8 +136,7 @@ build_opfncall (code, flags, xarg1, xarg2, arg3)
compiler faster). */
tree
-hack_identifier (value, name)
- tree value, name;
+hack_identifier (tree value, tree name)
{
tree type;
@@ -265,67 +264,70 @@ request for member `%D' is ambiguous in multiple inheritance lattice",
}
-/* Return a thunk to FUNCTION. For a virtual thunk, DELTA is the
- offset to this used to locate the vptr, and VCALL_INDEX is used to
- look up the eventual subobject location. For a non-virtual thunk,
- DELTA is the offset to this and VCALL_INDEX is NULL. */
+/* Return a this or result adjusting thunk to FUNCTION. THIS_ADJUSTING
+ indicates whether it is a this or result adjusting thunk.
+ FIXED_OFFSET and VIRTUAL_OFFSET indicate how to do the adjustment
+ (see thunk_adjust). VIRTUAL_OFFSET can be NULL, but FIXED_OFFSET
+ never is. VIRTUAL_OFFSET is the /index/ into the vtable for this
+ adjusting thunks, we scale it to a byte offset. For covariant
+ thunks VIRTUAL_OFFSET is the virtual binfo. You must post process
+ the returned thunk with finish_thunk. */
tree
-make_thunk (function, delta, vcall_index)
- tree function;
- tree delta;
- tree vcall_index;
+make_thunk (tree function, bool this_adjusting,
+ tree fixed_offset, tree virtual_offset)
{
- tree thunk_id;
- tree thunk;
- tree vcall_offset;
HOST_WIDE_INT d;
-
+ tree thunk;
+
my_friendly_assert (TREE_CODE (function) == FUNCTION_DECL, 20021025);
-
- /* Scale the VCALL_INDEX to be in terms of bytes. */
- if (vcall_index)
- vcall_offset
+ /* We can have this thunks to covariant thunks, but not vice versa. */
+ my_friendly_assert (!DECL_THIS_THUNK_P (function), 20021127);
+
+ /* Scale the VIRTUAL_OFFSET to be in terms of bytes. */
+ if (this_adjusting && virtual_offset)
+ virtual_offset
= size_binop (MULT_EXPR,
- vcall_index,
- convert (ssizetype,
- TYPE_SIZE_UNIT (vtable_entry_type)));
- else
- vcall_offset = NULL_TREE;
-
- d = tree_low_cst (delta, 0);
-
- /* See if we already have the thunk in question. */
+ virtual_offset,
+ convert (ssizetype,
+ TYPE_SIZE_UNIT (vtable_entry_type)));
+
+ d = tree_low_cst (fixed_offset, 0);
+
+ /* See if we already have the thunk in question. For this_adjusting
+ thunks VIRTUAL_OFFSET will be an INTEGER_CST, for covariant thunks it
+ will be a BINFO (because of the organization of the layout
+ algorithm). */
for (thunk = DECL_THUNKS (function); thunk; thunk = TREE_CHAIN (thunk))
- if (THUNK_DELTA (thunk) == d
- && ((THUNK_VCALL_OFFSET (thunk) != NULL_TREE)
- == (vcall_offset != NULL_TREE))
- && (THUNK_VCALL_OFFSET (thunk)
- ? tree_int_cst_equal (THUNK_VCALL_OFFSET (thunk),
- vcall_offset)
- : true))
+ 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))
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);
- thunk_id = mangle_thunk (function, delta, vcall_offset);
- thunk = build_decl (FUNCTION_DECL, thunk_id, TREE_TYPE (function));
+ thunk = build_decl (FUNCTION_DECL, NULL_TREE, TREE_TYPE (function));
DECL_LANG_SPECIFIC (thunk) = DECL_LANG_SPECIFIC (function);
cxx_dup_lang_specific_decl (function);
- SET_DECL_ASSEMBLER_NAME (thunk, thunk_id);
DECL_CONTEXT (thunk) = DECL_CONTEXT (function);
TREE_READONLY (thunk) = TREE_READONLY (function);
TREE_THIS_VOLATILE (thunk) = TREE_THIS_VOLATILE (function);
TREE_PUBLIC (thunk) = TREE_PUBLIC (function);
if (flag_weak)
comdat_linkage (thunk);
- SET_DECL_THUNK_P (thunk);
+ SET_DECL_THUNK_P (thunk, this_adjusting);
DECL_INITIAL (thunk) = build1 (ADDR_EXPR, vfunc_ptr_type_node, function);
- THUNK_DELTA (thunk) = d;
- THUNK_VCALL_OFFSET (thunk) = vcall_offset;
+ THUNK_FIXED_OFFSET (thunk) = tree_low_cst (fixed_offset, 0);
+ THUNK_VIRTUAL_OFFSET (thunk) = virtual_offset;
+
/* The thunk itself is not a constructor or destructor, even if
the thing it is thunking to is. */
DECL_INTERFACE_KNOWN (thunk) = 1;
@@ -351,18 +353,85 @@ make_thunk (function, delta, vcall_index)
return thunk;
}
-/* Emit the definition of a C++ multiple inheritance vtable thunk. If
- EMIT_P is nonzero, the thunk is emitted immediately. */
+/* Finish THUNK, a thunk decl. FIXED_OFFSET and VIRTUAL_OFFSET are the
+ adjustments to apply. */
void
-use_thunk (thunk_fndecl, emit_p)
- tree thunk_fndecl;
- int emit_p;
+finish_thunk (tree thunk, tree fixed_offset, tree virtual_offset)
+{
+ tree function, name;
+
+ my_friendly_assert (!DECL_NAME (thunk) && DECL_THUNK_P (thunk), 20021127);
+ function = TREE_OPERAND (DECL_INITIAL (thunk), 0);
+ name = mangle_thunk (function, DECL_THIS_THUNK_P (thunk),
+ fixed_offset, virtual_offset);
+ THUNK_FIXED_OFFSET (thunk) = tree_low_cst (fixed_offset, 0);
+ THUNK_VIRTUAL_OFFSET (thunk) = virtual_offset;
+ DECL_NAME (thunk) = name;
+ SET_DECL_ASSEMBLER_NAME (thunk, name);
+}
+
+/* Adjust PTR by the constant FIXED_OFFSET, and by the vtable
+ offset indicated by VIRTUAL_OFFSET, if that is
+ non-null. THIS_ADJUSTING is non-zero for a this adjusting thunk and
+ zero for a result adjusting thunk. */
+
+static tree
+thunk_adjust (tree ptr, bool this_adjusting,
+ HOST_WIDE_INT fixed_offset, tree virtual_offset)
+{
+ if (this_adjusting)
+ /* Adjust the pointer by the constant. */
+ ptr = fold (build (PLUS_EXPR, TREE_TYPE (ptr), ptr,
+ ssize_int (fixed_offset)));
+
+ /* If there's a virtual offset, look up that value in the vtable and
+ adjust the pointer again. */
+ if (virtual_offset)
+ {
+ tree vtable;
+
+ /* It shouldn't be a binfo any more. */
+ my_friendly_assert (TREE_CODE (virtual_offset) == INTEGER_CST, 20021127);
+
+ ptr = save_expr (ptr);
+ /* The vptr is always at offset zero in the object. */
+ vtable = build1 (NOP_EXPR,
+ build_pointer_type (build_pointer_type
+ (vtable_entry_type)),
+ ptr);
+ /* Form the vtable address. */
+ vtable = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (vtable)), vtable);
+ /* Find the entry with the vcall offset. */
+ vtable = build (PLUS_EXPR, TREE_TYPE (vtable), vtable, virtual_offset);
+ /* Get the offset itself. */
+ vtable = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (vtable)), vtable);
+ /* Adjust the `this' pointer. */
+ ptr = fold (build (PLUS_EXPR, TREE_TYPE (ptr), ptr, vtable));
+ }
+
+ if (!this_adjusting)
+ /* Adjust the pointer by the constant. */
+ ptr = fold (build (PLUS_EXPR, TREE_TYPE (ptr), ptr,
+ ssize_int (fixed_offset)));
+
+ return ptr;
+}
+
+/* Emit the definition of a C++ multiple inheritance or covariant
+ return vtable thunk. If EMIT_P is nonzero, the thunk is emitted
+ immediately. */
+
+void
+use_thunk (tree thunk_fndecl, bool emit_p)
{
tree fnaddr;
tree function;
- tree vcall_offset;
- HOST_WIDE_INT delta, vcall_value;
+ tree virtual_offset;
+ HOST_WIDE_INT fixed_offset, virtual_value;
+
+ /* We should have called finish_thunk to give it a name. */
+ my_friendly_assert (DECL_NAME (thunk_fndecl), 20021127);
if (TREE_ASM_WRITTEN (thunk_fndecl))
return;
@@ -385,20 +454,13 @@ use_thunk (thunk_fndecl, emit_p)
if (!emit_p)
return;
- delta = THUNK_DELTA (thunk_fndecl);
- vcall_offset = THUNK_VCALL_OFFSET (thunk_fndecl);
-
- if (vcall_offset)
- {
- vcall_value = tree_low_cst (vcall_offset, /*pos=*/0);
-
- /* It is expected that a value of zero means no vcall. */
- if (!vcall_value)
- abort ();
- }
- else
- vcall_value = 0;
+ fixed_offset = THUNK_FIXED_OFFSET (thunk_fndecl);
+ virtual_offset = THUNK_VIRTUAL_OFFSET (thunk_fndecl);
+ virtual_value = (virtual_offset
+ ? tree_low_cst (virtual_offset, /*pos=*/0) : 0);
+ my_friendly_assert (!virtual_offset || virtual_value, 20021026);
+
/* And, if we need to emit the thunk, it's used. */
mark_used (thunk_fndecl);
/* This thunk is actually defined. */
@@ -421,8 +483,9 @@ use_thunk (thunk_fndecl, emit_p)
BLOCK_VARS (DECL_INITIAL (thunk_fndecl))
= DECL_ARGUMENTS (thunk_fndecl);
- if (targetm.asm_out.can_output_mi_thunk (thunk_fndecl, delta,
- vcall_value, function))
+ if (DECL_THIS_THUNK_P (thunk_fndecl)
+ && targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset,
+ virtual_value, function))
{
const char *fnname;
current_function_decl = thunk_fndecl;
@@ -433,8 +496,8 @@ use_thunk (thunk_fndecl, emit_p)
current_function_is_thunk = 1;
assemble_start_function (thunk_fndecl, fnname);
- targetm.asm_out.output_mi_thunk (asm_out_file, thunk_fndecl, delta,
- vcall_value, function);
+ targetm.asm_out.output_mi_thunk (asm_out_file, thunk_fndecl,
+ fixed_offset, virtual_value, function);
assemble_end_function (thunk_fndecl, fnname);
current_function_decl = 0;
@@ -443,9 +506,10 @@ use_thunk (thunk_fndecl, emit_p)
}
else
{
- /* If we don't have the necessary code for efficient thunks,
- generate a thunk function that just makes a call to the real
- function. Unfortunately, this doesn't work for varargs. */
+ /* If this is a covariant thunk, or we don't have the necessary
+ code for efficient thunks, generate a thunk function that
+ just makes a call to the real function. Unfortunately, this
+ doesn't work for varargs. */
tree a, t;
@@ -453,7 +517,7 @@ use_thunk (thunk_fndecl, emit_p)
error ("generic thunk code fails for method `%#D' which uses `...'",
function);
- /* Set up clone argument trees for the thunk. */
+ /* Set up cloned argument trees for the thunk. */
t = NULL_TREE;
for (a = DECL_ARGUMENTS (function); a; a = TREE_CHAIN (a))
{
@@ -469,42 +533,22 @@ use_thunk (thunk_fndecl, emit_p)
start_function (NULL_TREE, thunk_fndecl, NULL_TREE, SF_PRE_PARSED);
/* We don't bother with a body block for thunks. */
- /* Adjust the this pointer by the constant. */
- t = ssize_int (delta);
- t = fold (build (PLUS_EXPR, TREE_TYPE (a), a, t));
-
- /* If there's a vcall offset, look up that value in the vtable and
- adjust the `this' pointer again. */
- if (vcall_offset && !integer_zerop (vcall_offset))
- {
- tree orig_this;
-
- t = save_expr (t);
- orig_this = t;
- /* The vptr is always at offset zero in the object. */
- t = build1 (NOP_EXPR,
- build_pointer_type (build_pointer_type
- (vtable_entry_type)),
- t);
- /* Form the vtable address. */
- t = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (t)), t);
- /* Find the entry with the vcall offset. */
- t = build (PLUS_EXPR, TREE_TYPE (t), t, vcall_offset);
- /* Calculate the offset itself. */
- t = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (t)), t);
- /* Adjust the `this' pointer. */
- t = fold (build (PLUS_EXPR,
- TREE_TYPE (orig_this),
- orig_this,
- t));
- }
-
+ t = a;
+
+ if (DECL_THIS_THUNK_P (thunk_fndecl))
+ t = thunk_adjust (t, /*this_adjusting=*/1,
+ fixed_offset, virtual_offset);
+
/* Build up the call to the real function. */
t = tree_cons (NULL_TREE, t, NULL_TREE);
for (a = TREE_CHAIN (a); a; a = TREE_CHAIN (a))
t = tree_cons (NULL_TREE, a, t);
t = nreverse (t);
t = build_call (function, t);
+ if (DECL_RESULT_THUNK_P (thunk_fndecl))
+ t = thunk_adjust (t, /*this_adjusting=*/0,
+ fixed_offset, virtual_offset);
+
if (VOID_TYPE_P (TREE_TYPE (t)))
finish_expr_stmt (t);
else
@@ -528,8 +572,7 @@ use_thunk (thunk_fndecl, emit_p)
/* Generate code for default X(X&) constructor. */
static void
-do_build_copy_constructor (fndecl)
- tree fndecl;
+do_build_copy_constructor (tree fndecl)
{
tree parm = FUNCTION_FIRST_USER_PARM (fndecl);
tree t;
@@ -632,8 +675,7 @@ do_build_copy_constructor (fndecl)
}
static void
-do_build_assign_ref (fndecl)
- tree fndecl;
+do_build_assign_ref (tree fndecl)
{
tree parm = TREE_CHAIN (DECL_ARGUMENTS (fndecl));
tree compound_stmt;
@@ -735,12 +777,11 @@ do_build_assign_ref (fndecl)
}
void
-synthesize_method (fndecl)
- tree fndecl;
+synthesize_method (tree fndecl)
{
- int nested = (current_function_decl != NULL_TREE);
+ bool nested = (current_function_decl != NULL_TREE);
tree context = decl_function_context (fndecl);
- int need_body = 1;
+ bool need_body = true;
tree stmt;
if (at_eof)
@@ -777,7 +818,7 @@ synthesize_method (fndecl)
if (DECL_OVERLOADED_OPERATOR_P (fndecl) == NOP_EXPR)
{
do_build_assign_ref (fndecl);
- need_body = 0;
+ need_body = false;
}
else if (DECL_CONSTRUCTOR_P (fndecl))
{
@@ -814,10 +855,8 @@ synthesize_method (fndecl)
variants yet, so we need to look at the main one. */
static tree
-synthesize_exception_spec (type, extractor, client)
- tree type;
- tree (*extractor) (tree, void *);
- void *client;
+synthesize_exception_spec (tree type, tree (*extractor) (tree, void*),
+ void *client)
{
tree raises = empty_except_spec;
tree fields = TYPE_FIELDS (type);
@@ -861,9 +900,7 @@ synthesize_exception_spec (type, extractor, client)
/* Locate the dtor of TYPE. */
static tree
-locate_dtor (type, client)
- tree type;
- void *client ATTRIBUTE_UNUSED;
+locate_dtor (tree type, void *client ATTRIBUTE_UNUSED)
{
tree fns;
@@ -877,9 +914,7 @@ locate_dtor (type, client)
/* Locate the default ctor of TYPE. */
static tree
-locate_ctor (type, client)
- tree type;
- void *client ATTRIBUTE_UNUSED;
+locate_ctor (tree type, void *client ATTRIBUTE_UNUSED)
{
tree fns;
@@ -910,15 +945,13 @@ struct copy_data
and desired qualifiers of the source operand. */
static tree
-locate_copy (type, client_)
- tree type;
- void *client_;
+locate_copy (tree type, void *client_)
{
struct copy_data *client = (struct copy_data *)client_;
tree fns;
int ix = -1;
tree best = NULL_TREE;
- int excess_p = 0;
+ bool excess_p = false;
if (client->name)
{
@@ -971,16 +1004,13 @@ locate_copy (type, client_)
reference argument or a non-const reference. */
tree
-implicitly_declare_fn (kind, type, const_p)
- special_function_kind kind;
- tree type;
- int const_p;
+implicitly_declare_fn (special_function_kind kind, tree type, bool const_p)
{
tree declspecs = NULL_TREE;
tree fn, args = NULL_TREE;
tree raises = empty_except_spec;
- int retref = 0;
- int has_parm = 0;
+ bool retref = false;
+ bool has_parm = false;
tree name = constructor_name (TYPE_IDENTIFIER (type));
switch (kind)
@@ -1004,12 +1034,12 @@ implicitly_declare_fn (kind, type, const_p)
struct copy_data data;
tree argtype = type;
- has_parm = 1;
+ has_parm = true;
data.name = NULL;
data.quals = 0;
if (kind == sfk_assignment_operator)
{
- retref = 1;
+ retref = true;
declspecs = build_tree_list (NULL_TREE, type);
name = ansi_assopname (NOP_EXPR);
@@ -1061,8 +1091,7 @@ implicitly_declare_fn (kind, type, const_p)
as there are artificial parms in FN. */
tree
-skip_artificial_parms_for (fn, list)
- tree fn, list;
+skip_artificial_parms_for (tree fn, tree list)
{
if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn))
list = TREE_CHAIN (list);
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index 6fbcc2be192..6de190d4811 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "cp-tree.h"
#include "rtl.h"
@@ -37,15 +39,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Prototypes. */
-static tree calls_setjmp_r PARAMS ((tree *, int *, void *));
-static void update_cloned_parm PARAMS ((tree, tree));
-static void dump_function PARAMS ((enum tree_dump_index, tree));
+static tree calls_setjmp_r (tree *, int *, void *);
+static void update_cloned_parm (tree, tree);
+static void dump_function (enum tree_dump_index, tree);
/* Optimize the body of FN. */
void
-optimize_function (fn)
- tree fn;
+optimize_function (tree fn)
{
dump_function (TDI_original, fn);
@@ -81,10 +82,8 @@ optimize_function (fn)
/* Called from calls_setjmp_p via walk_tree. */
static tree
-calls_setjmp_r (tp, walk_subtrees, data)
- tree *tp;
- int *walk_subtrees ATTRIBUTE_UNUSED;
- void *data ATTRIBUTE_UNUSED;
+calls_setjmp_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED)
{
/* We're only interested in FUNCTION_DECLS. */
if (TREE_CODE (*tp) != FUNCTION_DECL)
@@ -98,9 +97,8 @@ calls_setjmp_r (tp, walk_subtrees, data)
occasionally return a nonzero value even when FN does not actually
call `setjmp'. */
-int
-calls_setjmp_p (fn)
- tree fn;
+bool
+calls_setjmp_p (tree fn)
{
return walk_tree_without_duplicates (&DECL_SAVED_TREE (fn),
calls_setjmp_r,
@@ -113,9 +111,7 @@ calls_setjmp_p (fn)
debugging generation code will be able to find the original PARM. */
static void
-update_cloned_parm (parm, cloned_parm)
- tree parm;
- tree cloned_parm;
+update_cloned_parm (tree parm, tree cloned_parm)
{
DECL_ABSTRACT_ORIGIN (cloned_parm) = parm;
@@ -136,12 +132,11 @@ update_cloned_parm (parm, cloned_parm)
necessary. Returns nonzero if there's no longer any need to
process the main body. */
-int
-maybe_clone_body (fn)
- tree fn;
+bool
+maybe_clone_body (tree fn)
{
tree clone;
- int first = 1;
+ bool first = true;
/* We only clone constructors and destructors. */
if (!DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (fn)
@@ -155,7 +150,7 @@ maybe_clone_body (fn)
list. */
for (clone = TREE_CHAIN (fn);
clone && DECL_CLONED_FUNCTION_P (clone);
- clone = TREE_CHAIN (clone), first = 0)
+ clone = TREE_CHAIN (clone), first = false)
{
tree parm;
tree clone_parm;
@@ -278,9 +273,7 @@ maybe_clone_body (fn)
/* Dump FUNCTION_DECL FN as tree dump PHASE. */
static void
-dump_function (phase, fn)
- enum tree_dump_index phase;
- tree fn;
+dump_function (enum tree_dump_index phase, tree fn)
{
FILE *stream;
int flags;
diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y
index 0be461eada5..2f0fd937fcb 100644
--- a/gcc/cp/parse.y
+++ b/gcc/cp/parse.y
@@ -31,6 +31,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "input.h"
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index fa3caac01dc..275605e9d9e 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -28,6 +28,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "obstack.h"
#include "tree.h"
#include "flags.h"
diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c
index f40e412726c..4a47560ea65 100644
--- a/gcc/cp/ptree.c
+++ b/gcc/cp/ptree.c
@@ -23,6 +23,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "cp-tree.h"
diff --git a/gcc/cp/repo.c b/gcc/cp/repo.c
index 64c6ec873fc..ad7a1f68497 100644
--- a/gcc/cp/repo.c
+++ b/gcc/cp/repo.c
@@ -27,6 +27,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "cp-tree.h"
#include "input.h"
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 7540b5c0e72..d8041ab53e4 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -23,6 +23,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "cp-tree.h"
#include "flags.h"
@@ -1150,8 +1152,7 @@ create_pseudo_type_info VPARAMS((const char *real_name, int ident, ...))
{
tree pseudo_type;
char *pseudo_name;
- int ix;
- tree fields[10];
+ tree fields;
tree field_decl;
tree result;
@@ -1167,15 +1168,18 @@ create_pseudo_type_info VPARAMS((const char *real_name, int ident, ...))
sprintf (pseudo_name + strlen (pseudo_name), "%d", ident);
/* First field is the pseudo type_info base class. */
- fields[0] = build_decl (FIELD_DECL, NULL_TREE, ti_desc_type_node);
+ fields = build_decl (FIELD_DECL, NULL_TREE, ti_desc_type_node);
/* Now add the derived fields. */
- for (ix = 0; (field_decl = va_arg (ap, tree));)
- fields[++ix] = field_decl;
+ while ((field_decl = va_arg (ap, tree)))
+ {
+ TREE_CHAIN (field_decl) = fields;
+ fields = field_decl;
+ }
/* Create the pseudo type. */
pseudo_type = make_aggr_type (RECORD_TYPE);
- finish_builtin_type (pseudo_type, pseudo_name, fields, ix, ptr_type_node);
+ finish_builtin_struct (pseudo_type, pseudo_name, fields, NULL_TREE);
CLASSTYPE_AS_BASE (pseudo_type) = pseudo_type;
result = tree_cons (NULL_TREE, NULL_TREE, NULL_TREE);
@@ -1285,13 +1289,18 @@ create_tinfo_types ()
/* Create the internal type_info structure. This is used as a base for
the other structures. */
{
- tree fields[2];
+ tree field, fields;
ti_desc_type_node = make_aggr_type (RECORD_TYPE);
- fields[0] = build_decl (FIELD_DECL, NULL_TREE, const_ptr_type_node);
- fields[1] = build_decl (FIELD_DECL, NULL_TREE, const_string_type_node);
- finish_builtin_type (ti_desc_type_node, "__type_info_pseudo",
- fields, 1, ptr_type_node);
+ field = build_decl (FIELD_DECL, NULL_TREE, const_ptr_type_node);
+ fields = field;
+
+ field = build_decl (FIELD_DECL, NULL_TREE, const_string_type_node);
+ TREE_CHAIN (field) = fields;
+ fields = field;
+
+ finish_builtin_struct (ti_desc_type_node, "__type_info_pseudo",
+ fields, NULL_TREE);
TYPE_HAS_CONSTRUCTOR (ti_desc_type_node) = 1;
}
@@ -1326,13 +1335,18 @@ create_tinfo_types ()
/* Base class internal helper. Pointer to base type, offset to base,
flags. */
{
- tree fields[2];
+ tree field, fields;
+
+ field = build_decl (FIELD_DECL, NULL_TREE, type_info_ptr_type);
+ fields = field;
- fields[0] = build_decl (FIELD_DECL, NULL_TREE, type_info_ptr_type);
- fields[1] = build_decl (FIELD_DECL, NULL_TREE, integer_types[itk_long]);
+ field = build_decl (FIELD_DECL, NULL_TREE, integer_types[itk_long]);
+ TREE_CHAIN (field) = fields;
+ fields = field;
+
base_desc_type_node = make_aggr_type (RECORD_TYPE);
- finish_builtin_type (base_desc_type_node, "__base_class_type_info_pseudo",
- fields, 1, ptr_type_node);
+ finish_builtin_struct (base_desc_type_node, "__base_class_type_info_pseudo",
+ fields, NULL_TREE);
TYPE_HAS_CONSTRUCTOR (base_desc_type_node) = 1;
}
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index fefd11b8b16..4c03f073afd 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -25,6 +25,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "cp-tree.h"
#include "obstack.h"
@@ -97,7 +99,6 @@ static tree dfs_push_type_decls PARAMS ((tree, void *));
static tree dfs_push_decls PARAMS ((tree, void *));
static tree dfs_unuse_fields PARAMS ((tree, void *));
static tree add_conversions PARAMS ((tree, void *));
-static int covariant_return_p PARAMS ((tree, tree));
static int look_for_overrides_r PARAMS ((tree, tree));
static struct search_level *push_search_level
PARAMS ((struct stack_level *, struct obstack *));
@@ -1850,58 +1851,6 @@ dfs_walk (binfo, fn, qfn, data)
return dfs_walk_real (binfo, 0, fn, qfn, data);
}
-/* Returns > 0 if a function with type DRETTYPE overriding a function
- with type BRETTYPE is covariant, as defined in [class.virtual].
-
- Returns 1 if trivial covariance, 2 if non-trivial (requiring runtime
- adjustment), or -1 if pedantically invalid covariance. */
-
-static int
-covariant_return_p (brettype, drettype)
- tree brettype, drettype;
-{
- tree binfo;
- base_kind kind;
-
- if (TREE_CODE (brettype) == FUNCTION_DECL)
- {
- brettype = TREE_TYPE (TREE_TYPE (brettype));
- drettype = TREE_TYPE (TREE_TYPE (drettype));
- }
- else if (TREE_CODE (brettype) == METHOD_TYPE)
- {
- brettype = TREE_TYPE (brettype);
- drettype = TREE_TYPE (drettype);
- }
-
- if (same_type_p (brettype, drettype))
- return 0;
-
- if (! (TREE_CODE (brettype) == TREE_CODE (drettype)
- && (TREE_CODE (brettype) == POINTER_TYPE
- || TREE_CODE (brettype) == REFERENCE_TYPE)
- && TYPE_QUALS (brettype) == TYPE_QUALS (drettype)))
- return 0;
-
- if (! can_convert (brettype, drettype))
- return 0;
-
- brettype = TREE_TYPE (brettype);
- drettype = TREE_TYPE (drettype);
-
- /* If not pedantic, allow any standard pointer conversion. */
- if (! IS_AGGR_TYPE (drettype) || ! IS_AGGR_TYPE (brettype))
- return -1;
-
- binfo = lookup_base (drettype, brettype, ba_check | ba_quiet, &kind);
-
- if (!binfo)
- return 0;
- if (BINFO_OFFSET_ZEROP (binfo) && kind != bk_via_virtual)
- return 1;
- return 2;
-}
-
/* Check that virtual overrider OVERRIDER is acceptable for base function
BASEFN. Issue diagnostic, and return zero, if unacceptable. */
@@ -1915,32 +1864,74 @@ check_final_overrider (overrider, basefn)
tree base_return = TREE_TYPE (base_type);
tree over_throw = TYPE_RAISES_EXCEPTIONS (over_type);
tree base_throw = TYPE_RAISES_EXCEPTIONS (base_type);
- int i;
+ int fail = 0;
if (same_type_p (base_return, over_return))
/* OK */;
- else if ((i = covariant_return_p (base_return, over_return)))
+ else if ((CLASS_TYPE_P (over_return) && CLASS_TYPE_P (base_return))
+ || (TREE_CODE (base_return) == TREE_CODE (over_return)
+ && POINTER_TYPE_P (base_return)))
{
- if (i == 2)
- sorry ("adjusting pointers for covariant returns");
+ /* Potentially covariant. */
+ unsigned base_quals, over_quals;
+
+ fail = !POINTER_TYPE_P (base_return);
+ if (!fail)
+ {
+ fail = cp_type_quals (base_return) != cp_type_quals (over_return);
+
+ base_return = TREE_TYPE (base_return);
+ over_return = TREE_TYPE (over_return);
+ }
+ base_quals = cp_type_quals (base_return);
+ over_quals = cp_type_quals (over_return);
+
+ if ((base_quals & over_quals) != over_quals)
+ fail = 1;
+
+ if (CLASS_TYPE_P (base_return) && CLASS_TYPE_P (over_return))
+ {
+ tree binfo = lookup_base (over_return, base_return,
+ ba_check | ba_quiet, NULL);
- if (pedantic && i == -1)
+ if (!binfo)
+ fail = 1;
+ }
+ else if (!pedantic
+ && can_convert (TREE_TYPE (base_type), TREE_TYPE (over_type)))
+ /* GNU extension, allow trivial pointer conversions such as
+ converting to void *, or qualification conversion. */
{
- cp_pedwarn_at ("invalid covariant return type for `%#D'", overrider);
- cp_pedwarn_at (" overriding `%#D' (must be pointer or reference to class)", basefn);
+ /* can_convert will permit user defined conversion from a
+ (reference to) class type. We must reject them. */
+ over_return = TREE_TYPE (over_type);
+ if (TREE_CODE (over_return) == REFERENCE_TYPE)
+ over_return = TREE_TYPE (over_return);
+ if (CLASS_TYPE_P (over_return))
+ fail = 2;
}
+ else
+ fail = 2;
}
- else if (IS_AGGR_TYPE_2 (base_return, over_return)
- && same_or_base_type_p (base_return, over_return))
- {
- cp_error_at ("invalid covariant return type for `%#D'", overrider);
- cp_error_at (" overriding `%#D' (must use pointer or reference)", basefn);
- return 0;
- }
- else if (IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (overrider)) == NULL_TREE)
+ else
+ fail = 2;
+ if (!fail)
+ /* OK */;
+ else if (IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (overrider)))
+ return 0;
+ else
{
- cp_error_at ("conflicting return type specified for `%#D'", overrider);
- cp_error_at (" overriding `%#D'", basefn);
+ if (fail == 1)
+ {
+ cp_error_at ("invalid covariant return type for `%#D'", overrider);
+ cp_error_at (" overriding `%#D'", basefn);
+ }
+ else
+ {
+ cp_error_at ("conflicting return type specified for `%#D'",
+ overrider);
+ cp_error_at (" overriding `%#D'", basefn);
+ }
SET_IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (overrider),
DECL_CONTEXT (overrider));
return 0;
@@ -1949,10 +1940,16 @@ check_final_overrider (overrider, basefn)
/* Check throw specifier is at least as strict. */
if (!comp_except_specs (base_throw, over_throw, 0))
{
- cp_error_at ("looser throw specifier for `%#F'", overrider);
- cp_error_at (" overriding `%#F'", basefn);
+ if (!IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (overrider)))
+ {
+ cp_error_at ("looser throw specifier for `%#F'", overrider);
+ cp_error_at (" overriding `%#F'", basefn);
+ SET_IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (overrider),
+ DECL_CONTEXT (overrider));
+ }
return 0;
}
+
return 1;
}
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 81b4ccfdafc..1ceb1f37261 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -26,6 +26,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "cp-tree.h"
#include "tree-inline.h"
@@ -2188,7 +2190,7 @@ simplify_aggr_init_exprs_r (tp, walk_subtrees, data)
tree args;
tree slot;
tree type;
- int copy_from_buffer_p;
+ enum style_t { ctor, arg, pcc } style;
aggr_init_expr = *tp;
/* We don't need to walk into types; there's nothing in a type that
@@ -2210,48 +2212,66 @@ simplify_aggr_init_exprs_r (tp, walk_subtrees, data)
args = TREE_OPERAND (aggr_init_expr, 1);
slot = TREE_OPERAND (aggr_init_expr, 2);
type = TREE_TYPE (aggr_init_expr);
+
if (AGGR_INIT_VIA_CTOR_P (aggr_init_expr))
+ style = ctor;
+#ifdef PCC_STATIC_STRUCT_RETURN
+ else if (1)
+ style = pcc;
+#endif
+ else if (TREE_ADDRESSABLE (type))
+ style = arg;
+ else
+ /* We shouldn't build an AGGR_INIT_EXPR if we don't need any special
+ handling. See build_cplus_new. */
+ abort ();
+
+ if (style == ctor || style == arg)
{
- /* Replace the first argument with the address of the third
- argument to the AGGR_INIT_EXPR. */
+ /* Pass the address of the slot. If this is a constructor, we
+ replace the first argument; otherwise, we tack on a new one. */
+ if (style == ctor)
+ args = TREE_CHAIN (args);
+
cxx_mark_addressable (slot);
args = tree_cons (NULL_TREE,
build1 (ADDR_EXPR,
build_pointer_type (TREE_TYPE (slot)),
slot),
- TREE_CHAIN (args));
+ args);
}
+
call_expr = build (CALL_EXPR,
TREE_TYPE (TREE_TYPE (TREE_TYPE (fn))),
fn, args, NULL_TREE);
TREE_SIDE_EFFECTS (call_expr) = 1;
- /* If we're using the non-reentrant PCC calling convention, then we
- need to copy the returned value out of the static buffer into the
- SLOT. */
- copy_from_buffer_p = 0;
-#ifdef PCC_STATIC_STRUCT_RETURN
- if (!AGGR_INIT_VIA_CTOR_P (aggr_init_expr) && aggregate_value_p (type))
+ if (style == arg)
+ {
+ /* Tell the backend that we've added our return slot to the argument
+ list. */
+ CALL_EXPR_HAS_RETURN_SLOT_ADDR (call_expr) = 1;
+ /* And don't let anyone use the value of the call directly in a
+ larger expression. */
+ TREE_TYPE (call_expr) = void_type_node;
+ }
+ else if (style == pcc)
{
+ /* If we're using the non-reentrant PCC calling convention, then we
+ need to copy the returned value out of the static buffer into the
+ SLOT. */
int old_ac = flag_access_control;
flag_access_control = 0;
call_expr = build_aggr_init (slot, call_expr,
DIRECT_BIND | LOOKUP_ONLYCONVERTING);
flag_access_control = old_ac;
- copy_from_buffer_p = 1;
}
-#endif
- /* If this AGGR_INIT_EXPR indicates the value returned by a
- function, then we want to use the value of the initialized
- location as the result. */
- if (AGGR_INIT_VIA_CTOR_P (aggr_init_expr) || copy_from_buffer_p)
- {
- call_expr = build (COMPOUND_EXPR, type,
- call_expr, slot);
- TREE_SIDE_EFFECTS (call_expr) = 1;
- }
+ /* We want to use the value of the initialized location as the
+ result. */
+ call_expr = build (COMPOUND_EXPR, type,
+ call_expr, slot);
/* Replace the AGGR_INIT_EXPR with the CALL_EXPR. */
TREE_CHAIN (call_expr) = TREE_CHAIN (aggr_init_expr);
@@ -2275,8 +2295,19 @@ emit_associated_thunks (fn)
if (DECL_VIRTUAL_P (fn))
{
tree thunk;
+
for (thunk = DECL_THUNKS (fn); thunk; thunk = TREE_CHAIN (thunk))
- use_thunk (thunk, /*emit_p=*/1);
+ {
+ use_thunk (thunk, /*emit_p=*/1);
+ if (DECL_RESULT_THUNK_P (thunk))
+ {
+ tree probe;
+
+ for (probe = DECL_THUNKS (thunk);
+ probe; probe = TREE_CHAIN (probe))
+ use_thunk (probe, /*emit_p=*/1);
+ }
+ }
}
}
diff --git a/gcc/cp/spew.c b/gcc/cp/spew.c
index adc3ffd40cf..947ca36c6d4 100644
--- a/gcc/cp/spew.c
+++ b/gcc/cp/spew.c
@@ -25,6 +25,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "input.h"
#include "tree.h"
#include "cp-tree.h"
@@ -387,7 +389,8 @@ feed_input (input)
#ifdef SPEW_DEBUG
if (spew_debug)
fprintf (stderr, "\tfeeding %s:%d [%d tokens]\n",
- input->locus.file, input->locus.line, input->limit - input->pos);
+ input->locus.file, input->locus.line,
+ input->last_pos - input->cur_pos);
#endif
f->input = input;
@@ -1214,7 +1217,7 @@ snarf_method (decl)
#ifdef SPEW_DEBUG
if (spew_debug)
fprintf (stderr, "\tsaved method of %d tokens from %s:%d\n",
- meth->limit, starting.file, starting.line);
+ meth->last_pos, starting.file, starting.line);
#endif
DECL_PENDING_INLINE_INFO (decl) = meth;
@@ -1275,7 +1278,7 @@ snarf_defarg ()
#ifdef SPEW_DEBUG
if (spew_debug)
fprintf (stderr, "\tsaved defarg of %d tokens from %s:%d\n",
- buf->limit, starting.file, starting.line);
+ buf->last_pos, starting.file, starting.line);
#endif
arg = make_node (DEFAULT_ARG);
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 6c313eba4d8..4c328394114 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -22,6 +22,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "cp-tree.h"
#include "flags.h"
@@ -299,6 +301,7 @@ build_cplus_new (type, init)
tree fn;
tree slot;
tree rval;
+ int is_ctor;
/* Make sure that we're not trying to create an instance of an
abstract class. */
@@ -307,6 +310,11 @@ build_cplus_new (type, init)
if (TREE_CODE (init) != CALL_EXPR && TREE_CODE (init) != AGGR_INIT_EXPR)
return convert (type, init);
+ fn = TREE_OPERAND (init, 0);
+ is_ctor = (TREE_CODE (fn) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL
+ && DECL_CONSTRUCTOR_P (TREE_OPERAND (fn, 0)));
+
slot = build (VAR_DECL, type);
DECL_ARTIFICIAL (slot) = 1;
DECL_CONTEXT (slot) = current_function_decl;
@@ -320,13 +328,18 @@ build_cplus_new (type, init)
replaces every AGGR_INIT_EXPR with a copy that uses a fresh
temporary slot. Then, expand_expr builds up a call-expression
using the new slot. */
- fn = TREE_OPERAND (init, 0);
- rval = build (AGGR_INIT_EXPR, type, fn, TREE_OPERAND (init, 1), slot);
- TREE_SIDE_EFFECTS (rval) = 1;
- AGGR_INIT_VIA_CTOR_P (rval)
- = (TREE_CODE (fn) == ADDR_EXPR
- && TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL
- && DECL_CONSTRUCTOR_P (TREE_OPERAND (fn, 0)));
+
+ /* If we don't need to use a constructor to create an object of this
+ type, don't mess with AGGR_INIT_EXPR. */
+ if (is_ctor || TREE_ADDRESSABLE (type))
+ {
+ rval = build (AGGR_INIT_EXPR, type, fn, TREE_OPERAND (init, 1), slot);
+ TREE_SIDE_EFFECTS (rval) = 1;
+ AGGR_INIT_VIA_CTOR_P (rval) = is_ctor;
+ }
+ else
+ rval = init;
+
rval = build_target_expr (slot, rval);
return rval;
@@ -2311,33 +2324,32 @@ cp_auto_var_in_fn_p (var, fn)
tree
cp_copy_res_decl_for_inlining (result, fn, caller, decl_map_,
- need_decl, target_exprs)
+ need_decl, return_slot_addr)
tree result, fn, caller;
void *decl_map_;
int *need_decl;
- void *target_exprs;
+ tree return_slot_addr;
{
splay_tree decl_map = (splay_tree)decl_map_;
- varray_type *texps = (varray_type *)target_exprs;
tree var;
- int aggregate_return_p;
-
- /* Figure out whether or not FN returns an aggregate. */
- aggregate_return_p = IS_AGGR_TYPE (TREE_TYPE (result));
- *need_decl = ! aggregate_return_p;
- /* If FN returns an aggregate then the caller will always create the
- temporary (using a TARGET_EXPR) and the call will be the
- initializing expression for the TARGET_EXPR. If we were just to
+ /* If FN returns an aggregate then the caller will always pass the
+ address of the return slot explicitly. If we were just to
create a new VAR_DECL here, then the result of this function
would be copied (bitwise) into the variable initialized by the
TARGET_EXPR. That's incorrect, so we must transform any
references to the RESULT into references to the target. */
- if (aggregate_return_p)
+
+ /* We should have an explicit return slot iff the return type is
+ TREE_ADDRESSABLE. See simplify_aggr_init_expr. */
+ if (TREE_ADDRESSABLE (TREE_TYPE (result))
+ != (return_slot_addr != NULL_TREE))
+ abort ();
+
+ *need_decl = !return_slot_addr;
+ if (return_slot_addr)
{
- if (VARRAY_ACTIVE_SIZE (*texps) == 0)
- abort ();
- var = TREE_OPERAND (VARRAY_TOP_TREE (*texps), 0);
+ var = build_indirect_ref (return_slot_addr, "");
if (! same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (var),
TREE_TYPE (result)))
abort ();
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 85eef41c2e0..1c78dd1d057 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -32,6 +32,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "expr.h"
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 750aa3c94bf..e60fdcacb92 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -33,6 +33,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "cp-tree.h"
#include "flags.h"
diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c
index 81ee564ec7e..40d8d908f8b 100644
--- a/gcc/cppdefault.c
+++ b/gcc/cppdefault.c
@@ -24,6 +24,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "cppdefault.h"
const struct default_include cpp_include_defaults[]
diff --git a/gcc/cpperror.c b/gcc/cpperror.c
index 360bc8ccef3..20d8c8cb26e 100644
--- a/gcc/cpperror.c
+++ b/gcc/cpperror.c
@@ -25,6 +25,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
#include "intl.h"
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index 7f576f211e4..f3996627883 100644
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -20,6 +20,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index 2e11912934a..4d8219661d0 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -22,6 +22,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
#include "intl.h"
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index 98d51be0a4c..77bf9c07439 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -25,6 +25,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index 82b3056b704..324cb7784eb 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -21,6 +21,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
#include "prefix.h"
@@ -87,7 +89,7 @@ struct cpp_pending
#endif
static void path_include PARAMS ((cpp_reader *,
- char *, int));
+ const char *, int));
static void init_library PARAMS ((void));
static void init_builtins PARAMS ((cpp_reader *));
static void mark_named_operators PARAMS ((cpp_reader *));
@@ -150,19 +152,21 @@ END
#undef END
#undef TRIGRAPH_MAP
-/* Given a colon-separated list of file names PATH,
+/* Read ENV_VAR for a colon-separated list of file names; and
add all the names to the search path for include files. */
static void
-path_include (pfile, list, path)
+path_include (pfile, env_var, path)
cpp_reader *pfile;
- char *list;
+ const char *env_var;
int path;
{
char *p, *q, *name;
- p = list;
+ GET_ENVIRONMENT (q, env_var);
+ if (!q)
+ return;
- do
+ for (p = q; *q; p = q + 1)
{
/* Find the end of this name. */
q = p;
@@ -183,13 +187,7 @@ path_include (pfile, list, path)
}
append_include_chain (pfile, name, path, path == SYSTEM);
-
- /* Advance past this name. */
- if (*q == 0)
- break;
- p = q + 1;
}
- while (1);
}
/* Append DIR to include path PATH. DIR must be allocated on the
@@ -710,7 +708,8 @@ mark_named_operators (pfile)
{
cpp_hashnode *hp = cpp_lookup (pfile, b->name, b->len);
hp->flags |= NODE_OPERATOR;
- hp->value.operator = b->value;
+ hp->is_directive = 0;
+ hp->directive_index = b->value;
}
}
@@ -755,38 +754,9 @@ static void
init_standard_includes (pfile)
cpp_reader *pfile;
{
- char *path;
const struct default_include *p;
const char *specd_prefix = CPP_OPTION (pfile, include_prefix);
- /* Several environment variables may add to the include search path.
- CPATH specifies an additional list of directories to be searched
- as if specified with -I, while C_INCLUDE_PATH, CPLUS_INCLUDE_PATH,
- etc. specify an additional list of directories to be searched as
- if specified with -isystem, for the language indicated. */
-
- GET_ENVIRONMENT (path, "CPATH");
- if (path != 0 && *path != 0)
- path_include (pfile, path, BRACKET);
-
- switch ((CPP_OPTION (pfile, objc) << 1) + CPP_OPTION (pfile, cplusplus))
- {
- case 0:
- GET_ENVIRONMENT (path, "C_INCLUDE_PATH");
- break;
- case 1:
- GET_ENVIRONMENT (path, "CPLUS_INCLUDE_PATH");
- break;
- case 2:
- GET_ENVIRONMENT (path, "OBJC_INCLUDE_PATH");
- break;
- case 3:
- GET_ENVIRONMENT (path, "OBJCPLUS_INCLUDE_PATH");
- break;
- }
- if (path != 0 && *path != 0)
- path_include (pfile, path, SYSTEM);
-
/* Search "translated" versions of GNU directories.
These have /usr/local/lib/gcc... replaced by specd_prefix. */
if (specd_prefix != 0 && cpp_GCC_INCLUDE_DIR_len)
@@ -950,6 +920,11 @@ cpp_read_main_file (pfile, fname, table)
const char *fname;
hash_table *table;
{
+ static const char *const lang_env_vars[] =
+ { "C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH",
+ "OBJC_INCLUDE_PATH", "OBJCPLUS_INCLUDE_PATH" };
+ size_t lang;
+
sanity_checks (pfile);
post_options (pfile);
@@ -959,6 +934,15 @@ cpp_read_main_file (pfile, fname, table)
hashtable is deferred until now. */
_cpp_init_hashtable (pfile, table);
+ /* Several environment variables may add to the include search path.
+ CPATH specifies an additional list of directories to be searched
+ as if specified with -I, while C_INCLUDE_PATH, CPLUS_INCLUDE_PATH,
+ etc. specify an additional list of directories to be searched as
+ if specified with -isystem, for the language indicated. */
+ path_include (pfile, "CPATH", BRACKET);
+ lang = (CPP_OPTION (pfile, objc) << 1) + CPP_OPTION (pfile, cplusplus);
+ path_include (pfile, lang_env_vars[lang], SYSTEM);
+
/* Set up the include search path now. */
if (! CPP_OPTION (pfile, no_standard_includes))
init_standard_includes (pfile);
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 7db6b24b253..e8d7b7e56d6 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -22,6 +22,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
@@ -1071,7 +1073,7 @@ _cpp_lex_direct (pfile)
if (result->val.node->flags & NODE_OPERATOR)
{
result->flags |= NAMED_OP;
- result->type = result->val.node->value.operator;
+ result->type = result->val.node->directive_index;
}
break;
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index f8a702d8c1a..e032e75bef5 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -21,6 +21,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
@@ -364,8 +366,8 @@ _cpp_handle_directive (pfile, indented)
if (dname->type == CPP_NAME)
{
- if (dname->val.node->directive_index)
- dir = &dtable[dname->val.node->directive_index - 1];
+ if (dname->val.node->is_directive)
+ dir = &dtable[dname->val.node->directive_index];
}
/* We do not recognize the # followed by a number extension in
assembler code. */
@@ -2002,6 +2004,7 @@ _cpp_init_directives (pfile)
for (i = 0; i < (unsigned int) N_DIRECTIVES; i++)
{
node = cpp_lookup (pfile, dtable[i].name, dtable[i].length);
- node->directive_index = i + 1;
+ node->is_directive = 1;
+ node->directive_index = i;
}
}
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 7b3a54a3576..fe1f89c50f6 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -443,6 +443,7 @@ extern const char *progname;
#define NODE_DIAGNOSTIC (1 << 3) /* Possible diagnostic when lexed. */
#define NODE_WARN (1 << 4) /* Warn if redefined or undefined. */
#define NODE_DISABLED (1 << 5) /* A disabled macro. */
+#define NODE_MACRO_ARG (1 << 6) /* Used during #define processing. */
/* Different flavors of hash node. */
enum node_type
@@ -477,18 +478,20 @@ enum builtin_type
struct cpp_hashnode
{
struct ht_identifier ident;
- unsigned short arg_index; /* Macro argument index. */
- unsigned char directive_index; /* Index into directive table. */
+ unsigned int is_directive : 1;
+ unsigned int directive_index : 7; /* If is_directive,
+ then index into directive table.
+ Otherwise, a NODE_OPERATOR. */
unsigned char rid_code; /* Rid code - for front ends. */
ENUM_BITFIELD(node_type) type : 8; /* CPP node type. */
unsigned char flags; /* CPP flags. */
- union
+ union _cpp_hashnode_value
{
cpp_macro *macro; /* If a macro. */
struct answer *answers; /* Answers to an assertion. */
- enum cpp_ttype operator; /* Code for a named operator. */
enum builtin_type builtin; /* Code for a builtin macro. */
+ unsigned short arg_index; /* Macro argument index. */
} value;
};
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c
index fe78993bc4d..a00b83520dc 100644
--- a/gcc/cppmacro.c
+++ b/gcc/cppmacro.c
@@ -25,6 +25,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
@@ -1306,8 +1308,9 @@ _cpp_save_parameter (pfile, macro, node)
cpp_macro *macro;
cpp_hashnode *node;
{
+ unsigned int len;
/* Constraint 6.10.3.6 - duplicate parameter names. */
- if (node->arg_index)
+ if (node->flags & NODE_MACRO_ARG)
{
cpp_error (pfile, DL_ERROR, "duplicate macro parameter \"%s\"",
NODE_NAME (node));
@@ -1319,7 +1322,17 @@ _cpp_save_parameter (pfile, macro, node)
_cpp_extend_buff (pfile, &pfile->a_buff, sizeof (cpp_hashnode *));
((cpp_hashnode **) BUFF_FRONT (pfile->a_buff))[macro->paramc++] = node;
- node->arg_index = macro->paramc;
+ node->flags |= NODE_MACRO_ARG;
+ len = macro->paramc * sizeof (union _cpp_hashnode_value);
+ if (len > pfile->macro_buffer_len)
+ {
+ pfile->macro_buffer = (uchar *) xrealloc (pfile->macro_buffer, len);
+ pfile->macro_buffer_len = len;
+ }
+ ((union _cpp_hashnode_value *) pfile->macro_buffer)[macro->paramc - 1]
+ = node->value;
+
+ node->value.arg_index = macro->paramc;
return false;
}
@@ -1430,10 +1443,11 @@ lex_expansion_token (pfile, macro)
token = _cpp_lex_direct (pfile);
/* Is this a parameter? */
- if (token->type == CPP_NAME && token->val.node->arg_index)
+ if (token->type == CPP_NAME
+ && (token->val.node->flags & NODE_MACRO_ARG) != 0)
{
token->type = CPP_MACRO_ARG;
- token->val.arg_no = token->val.node->arg_index;
+ token->val.arg_no = token->val.node->value.arg_index;
}
else if (CPP_WTRADITIONAL (pfile) && macro->paramc > 0
&& (token->type == CPP_STRING || token->type == CPP_CHAR))
@@ -1583,7 +1597,11 @@ _cpp_create_definition (pfile, node)
/* Clear the fast argument lookup indices. */
for (i = macro->paramc; i-- > 0; )
- macro->params[i]->arg_index = 0;
+ {
+ struct cpp_hashnode *node = macro->params[i];
+ node->flags &= ~ NODE_MACRO_ARG;
+ node->value = ((union _cpp_hashnode_value *) pfile->macro_buffer)[i];
+ }
if (!ok)
return ok;
diff --git a/gcc/cppmain.c b/gcc/cppmain.c
index 9d8d42c2009..8088f78dacf 100644
--- a/gcc/cppmain.c
+++ b/gcc/cppmain.c
@@ -23,6 +23,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
diff --git a/gcc/cppspec.c b/gcc/cppspec.c
index e79968ab510..ef7238953fd 100644
--- a/gcc/cppspec.c
+++ b/gcc/cppspec.c
@@ -20,6 +20,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "gcc.h"
/* The `cpp' executable installed in $(bindir) and $(cpp_install_dir)
diff --git a/gcc/cpptrad.c b/gcc/cpptrad.c
index 902ae493b6a..92c4ee3d522 100644
--- a/gcc/cpptrad.c
+++ b/gcc/cpptrad.c
@@ -18,6 +18,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
@@ -597,12 +599,12 @@ scan_out_logical_line (pfile, macro)
goto new_context;
}
}
- else if (macro && node->arg_index)
+ else if (macro && (node->flags & NODE_MACRO_ARG) != 0)
{
/* Found a parameter in the replacement text of a
#define. Remove its name from the output. */
pfile->out.cur = out_start;
- save_replacement_text (pfile, macro, node->arg_index);
+ save_replacement_text (pfile, macro, node->value.arg_index);
out = pfile->out.base;
}
else if (lex_state == ls_hash)
@@ -714,7 +716,7 @@ scan_out_logical_line (pfile, macro)
else if (is_idstart (*cur))
/* Check whether we know this directive, but don't
advance. */
- do_it = lex_identifier (pfile, cur)->directive_index != 0;
+ do_it = lex_identifier (pfile, cur)->is_directive;
if (do_it || CPP_OPTION (pfile, lang) != CLK_ASM)
{
diff --git a/gcc/crtstuff.c b/gcc/crtstuff.c
index cdc447d248d..89f5dd67889 100644
--- a/gcc/crtstuff.c
+++ b/gcc/crtstuff.c
@@ -60,6 +60,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "auto-host.h"
#include "tconfig.h"
#include "tsystem.h"
+#include "coretypes.h"
+#include "tm.h"
#include "unwind-dw2-fde.h"
#ifndef FORCE_CODE_SECTION_ALIGN
diff --git a/gcc/cse.c b/gcc/cse.c
index 1d606b60c13..c9ba3c0e593 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -22,6 +22,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
/* stdio.h must precede rtl.h for FFS. */
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tm_p.h"
@@ -266,11 +268,11 @@ static struct qty_table_elem *qty_table;
static rtx prev_insn_cc0;
static enum machine_mode prev_insn_cc0_mode;
-#endif
/* Previous actual insn. 0 if at first insn of basic block. */
static rtx prev_insn;
+#endif
/* Insn being scanned. */
@@ -591,55 +593,7 @@ struct cse_basic_block_data
} path[PATHLENGTH];
};
-/* Nonzero if X has the form (PLUS frame-pointer integer). We check for
- virtual regs here because the simplify_*_operation routines are called
- by integrate.c, which is called before virtual register instantiation.
-
- ?!? FIXED_BASE_PLUS_P and NONZERO_BASE_PLUS_P need to move into
- a header file so that their definitions can be shared with the
- simplification routines in simplify-rtx.c. Until then, do not
- change these macros without also changing the copy in simplify-rtx.c. */
-
-#define FIXED_BASE_PLUS_P(X) \
- ((X) == frame_pointer_rtx || (X) == hard_frame_pointer_rtx \
- || ((X) == arg_pointer_rtx && fixed_regs[ARG_POINTER_REGNUM])\
- || (X) == virtual_stack_vars_rtx \
- || (X) == virtual_incoming_args_rtx \
- || (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == CONST_INT \
- && (XEXP (X, 0) == frame_pointer_rtx \
- || XEXP (X, 0) == hard_frame_pointer_rtx \
- || ((X) == arg_pointer_rtx \
- && fixed_regs[ARG_POINTER_REGNUM]) \
- || XEXP (X, 0) == virtual_stack_vars_rtx \
- || XEXP (X, 0) == virtual_incoming_args_rtx)) \
- || GET_CODE (X) == ADDRESSOF)
-
-/* Similar, but also allows reference to the stack pointer.
-
- This used to include FIXED_BASE_PLUS_P, however, we can't assume that
- arg_pointer_rtx by itself is nonzero, because on at least one machine,
- the i960, the arg pointer is zero when it is unused. */
-
-#define NONZERO_BASE_PLUS_P(X) \
- ((X) == frame_pointer_rtx || (X) == hard_frame_pointer_rtx \
- || (X) == virtual_stack_vars_rtx \
- || (X) == virtual_incoming_args_rtx \
- || (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == CONST_INT \
- && (XEXP (X, 0) == frame_pointer_rtx \
- || XEXP (X, 0) == hard_frame_pointer_rtx \
- || ((X) == arg_pointer_rtx \
- && fixed_regs[ARG_POINTER_REGNUM]) \
- || XEXP (X, 0) == virtual_stack_vars_rtx \
- || XEXP (X, 0) == virtual_incoming_args_rtx)) \
- || (X) == stack_pointer_rtx \
- || (X) == virtual_stack_dynamic_rtx \
- || (X) == virtual_outgoing_args_rtx \
- || (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == CONST_INT \
- && (XEXP (X, 0) == stack_pointer_rtx \
- || XEXP (X, 0) == virtual_stack_dynamic_rtx \
- || XEXP (X, 0) == virtual_outgoing_args_rtx)) \
- || GET_CODE (X) == ADDRESSOF)
-
+static bool fixed_base_plus_p PARAMS ((rtx x));
static int notreg_cost PARAMS ((rtx, enum rtx_code));
static int approx_reg_cost_1 PARAMS ((rtx *, void *));
static int approx_reg_cost PARAMS ((rtx));
@@ -702,6 +656,39 @@ static bool insn_live_p PARAMS ((rtx, int *));
static bool set_live_p PARAMS ((rtx, rtx, int *));
static bool dead_libcall_p PARAMS ((rtx, int *));
+/* Nonzero if X has the form (PLUS frame-pointer integer). We check for
+ virtual regs here because the simplify_*_operation routines are called
+ by integrate.c, which is called before virtual register instantiation. */
+
+static bool
+fixed_base_plus_p (x)
+ rtx x;
+{
+ switch (GET_CODE (x))
+ {
+ case REG:
+ if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx)
+ return true;
+ if (x == arg_pointer_rtx && fixed_regs[ARG_POINTER_REGNUM])
+ return true;
+ if (REGNO (x) >= FIRST_VIRTUAL_REGISTER
+ && REGNO (x) <= LAST_VIRTUAL_REGISTER)
+ return true;
+ return false;
+
+ case PLUS:
+ if (GET_CODE (XEXP (x, 1)) != CONST_INT)
+ return false;
+ return fixed_base_plus_p (XEXP (x, 0));
+
+ case ADDRESSOF:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
/* Dump the expressions in the equivalence class indicated by CLASSP.
This function is used only for debugging. */
void
@@ -1032,9 +1019,8 @@ new_basic_block ()
}
}
- prev_insn = 0;
-
#ifdef HAVE_cc0
+ prev_insn = 0;
prev_insn_cc0 = 0;
#endif
}
@@ -1611,7 +1597,7 @@ insert (x, classp, hash, mode)
|| (GET_CODE (x) == REG
&& RTX_UNCHANGING_P (x)
&& REGNO (x) >= FIRST_PSEUDO_REGISTER)
- || FIXED_BASE_PLUS_P (x));
+ || fixed_base_plus_p (x));
if (table[hash])
table[hash]->prev_same_hash = elt;
@@ -2378,10 +2364,9 @@ canon_hash (x, mode)
do_not_record = 1;
return 0;
}
- if (! RTX_UNCHANGING_P (x) || FIXED_BASE_PLUS_P (XEXP (x, 0)))
- {
- hash_arg_in_memory = 1;
- }
+ if (! RTX_UNCHANGING_P (x) || fixed_base_plus_p (XEXP (x, 0)))
+ hash_arg_in_memory = 1;
+
/* Now that we have already found this special case,
might as well speed it up as much as possible. */
hash += (unsigned) MEM;
@@ -2399,7 +2384,7 @@ canon_hash (x, mode)
hash += (unsigned) USE;
x = XEXP (x, 0);
- if (! RTX_UNCHANGING_P (x) || FIXED_BASE_PLUS_P (XEXP (x, 0)))
+ if (! RTX_UNCHANGING_P (x) || fixed_base_plus_p (XEXP (x, 0)))
hash_arg_in_memory = 1;
/* Now that we have already found this special case,
@@ -3276,9 +3261,10 @@ find_comparison_args (code, parg1, parg2, pmode1, pmode2)
break;
}
- /* If this is fp + constant, the equivalent is a better operand since
- it may let us predict the value of the comparison. */
- else if (NONZERO_BASE_PLUS_P (p->exp))
+ /* If this non-trapping address, e.g. fp + constant, the
+ equivalent is a better operand since it may let us predict
+ the value of the comparison. */
+ else if (!rtx_addr_can_trap_p (p->exp))
{
arg1 = p->exp;
continue;
@@ -3979,17 +3965,10 @@ fold_rtx (x, insn)
comparison. */
if (const_arg0 == 0 || const_arg1 == 0)
{
- /* Is FOLDED_ARG0 frame-pointer plus a constant? Or
- non-explicit constant? These aren't zero, but we
- don't know their sign. */
+ /* Some addresses are known to be nonzero. We don't know
+ their sign, but equality comparisons are known. */
if (const_arg1 == const0_rtx
- && (NONZERO_BASE_PLUS_P (folded_arg0)
-#if 0 /* Sad to say, on sysvr4, #pragma weak can make a symbol address
- come out as 0. */
- || GET_CODE (folded_arg0) == SYMBOL_REF
-#endif
- || GET_CODE (folded_arg0) == LABEL_REF
- || GET_CODE (folded_arg0) == CONST))
+ && nonzero_address_p (folded_arg0))
{
if (code == EQ)
return false_rtx;
@@ -6189,7 +6168,7 @@ cse_insn (insn, libcall_insn)
elt->in_memory = (GET_CODE (sets[i].inner_dest) == MEM
&& (! RTX_UNCHANGING_P (sets[i].inner_dest)
- || FIXED_BASE_PLUS_P (XEXP (sets[i].inner_dest,
+ || fixed_base_plus_p (XEXP (sets[i].inner_dest,
0))));
/* If we have (set (subreg:m1 (reg:m2 foo) 0) (bar:m1)), M1 is no
@@ -6400,9 +6379,8 @@ cse_insn (insn, libcall_insn)
prev_insn_cc0 = this_insn_cc0;
prev_insn_cc0_mode = this_insn_cc0_mode;
-#endif
-
prev_insn = insn;
+#endif
}
/* Remove from the hash table all expressions that reference memory. */
@@ -7306,8 +7284,8 @@ cse_basic_block (from, to, next_branch, around_loop)
Then follow this branch. */
#ifdef HAVE_cc0
prev_insn_cc0 = 0;
-#endif
prev_insn = insn;
+#endif
insn = JUMP_LABEL (insn);
continue;
}
diff --git a/gcc/cselib.c b/gcc/cselib.c
index feffa6de6cf..2ef4c575c1b 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tm_p.h"
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index 60ca66479f2..5fcd28d8fc1 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -70,6 +70,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
@@ -393,7 +395,7 @@ dbxout_function_end ()
the system doesn't insert underscores in front of user generated
labels. */
ASM_GENERATE_INTERNAL_LABEL (lscope_label_name, "Lscope", scope_labelno);
- ASM_OUTPUT_INTERNAL_LABEL (asmfile, "Lscope", scope_labelno);
+ (*targetm.asm_out.internal_label) (asmfile, "Lscope", scope_labelno);
scope_labelno++;
/* By convention, GCC will mark the end of a function with an N_FUN
@@ -466,7 +468,7 @@ dbxout_init (input_file_name)
assemble_name (asmfile, ltext_label_name);
fputc ('\n', asmfile);
text_section ();
- ASM_OUTPUT_INTERNAL_LABEL (asmfile, "Ltext", 0);
+ (*targetm.asm_out.internal_label) (asmfile, "Ltext", 0);
#endif /* no DBX_OUTPUT_MAIN_SOURCE_FILENAME */
#ifdef DBX_OUTPUT_GCC_MARKER
@@ -594,7 +596,7 @@ dbxout_source_file (file, filename)
; /* Don't change section amid function. */
else
text_section ();
- ASM_OUTPUT_INTERNAL_LABEL (file, "Ltext", source_label_number);
+ (*targetm.asm_out.internal_label) (file, "Ltext", source_label_number);
source_label_number++;
#endif
lastfile = filename;
@@ -625,7 +627,7 @@ dbxout_begin_block (line, n)
unsigned int line ATTRIBUTE_UNUSED;
unsigned int n;
{
- ASM_OUTPUT_INTERNAL_LABEL (asmfile, "LBB", n);
+ (*targetm.asm_out.internal_label) (asmfile, "LBB", n);
}
/* Describe the end line-number of an internal block within a function. */
@@ -635,7 +637,7 @@ dbxout_end_block (line, n)
unsigned int line ATTRIBUTE_UNUSED;
unsigned int n;
{
- ASM_OUTPUT_INTERNAL_LABEL (asmfile, "LBE", n);
+ (*targetm.asm_out.internal_label) (asmfile, "LBE", n);
}
/* Output dbx data for a function definition.
diff --git a/gcc/debug.c b/gcc/debug.c
index 682f6ed1be3..6a9c3925153 100644
--- a/gcc/debug.c
+++ b/gcc/debug.c
@@ -17,6 +17,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "debug.h"
/* The do-nothing debug hooks. */
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 0c71996c420..445aa5a5f5d 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -54,21 +54,27 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
# define CPP_PREDEFINES ""
#endif
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable or function named NAME.
+/* Store in OUTPUT a string (made with alloca) containing an
+ assembler-name for a local static variable or function named NAME.
LABELNO is an integer which is different for each call. */
+#ifndef ASM_PN_FORMAT
+# ifndef NO_DOT_IN_LABEL
+# define ASM_PN_FORMAT "%s.%lu"
+# else
+# ifndef NO_DOLLAR_IN_LABEL
+# define ASM_PN_FORMAT "%s$%lu"
+# else
+# define ASM_PN_FORMAT "__%s_%lu"
+# endif
+# endif
+#endif /* ! ASM_PN_FORMAT */
+
#ifndef ASM_FORMAT_PRIVATE_NAME
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
- do { \
- int len = strlen (NAME); \
- char *temp = (char *) alloca (len + 3); \
- temp[0] = 'L'; \
- strcpy (&temp[1], (NAME)); \
- temp[len + 1] = '.'; \
- temp[len + 2] = 0; \
- (OUTPUT) = (char *) alloca (strlen (NAME) + 11); \
- ASM_GENERATE_INTERNAL_LABEL (OUTPUT, temp, LABELNO); \
+# define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
+ do { const char *const name_ = (NAME); \
+ char *const output_ = (OUTPUT) = (char *) alloca (strlen (name_) + 32);\
+ sprintf (output_, ASM_PN_FORMAT, name_, (unsigned long)(LABELNO)); \
} while (0)
#endif
@@ -82,7 +88,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef ASM_OUTPUT_ADDR_VEC_ELT
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
do { fputs (integer_asm_op (POINTER_SIZE / UNITS_PER_WORD, TRUE), FILE); \
- ASM_OUTPUT_INTERNAL_LABEL (FILE, "L", (VALUE)); \
+ (*targetm.asm_out.internal_label) (FILE, "L", (VALUE)); \
fputc ('\n', FILE); \
} while (0)
#endif
@@ -160,7 +166,7 @@ do { fputs (integer_asm_op (POINTER_SIZE / UNITS_PER_WORD, TRUE), FILE); \
#ifndef ASM_OUTPUT_DEBUG_LABEL
#define ASM_OUTPUT_DEBUG_LABEL(FILE, PREFIX, NUM) \
- ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM)
+ (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM)
#endif
/* This is how we tell the assembler that a symbol is weak. */
diff --git a/gcc/df.c b/gcc/df.c
index 4228e0d6ebd..994f15b7676 100644
--- a/gcc/df.c
+++ b/gcc/df.c
@@ -155,6 +155,8 @@ Perhaps there should be a bitmap argument to df_analyse to specify
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tm_p.h"
#include "insn-config.h"
@@ -784,7 +786,6 @@ df_ref_create (df, reg, loc, insn, ref_type, ref_flags)
enum df_ref_flags ref_flags;
{
struct ref *this_ref;
- unsigned int uid;
this_ref = (struct ref *) obstack_alloc (&df_ref_obstack,
sizeof (*this_ref));
@@ -794,7 +795,6 @@ df_ref_create (df, reg, loc, insn, ref_type, ref_flags)
DF_REF_CHAIN (this_ref) = 0;
DF_REF_TYPE (this_ref) = ref_type;
DF_REF_FLAGS (this_ref) = ref_flags;
- uid = INSN_UID (insn);
if (ref_type == DF_REF_REG_DEF)
{
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index b6794b80ff8..015d2c4e291 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -27,6 +27,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#undef FLOAT /* This is for hpux. They should change hpux. */
#undef FFS /* Some systems define this in param.h. */
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "tm_p.h"
#include "flags.h"
diff --git a/gcc/doc/configfiles.texi b/gcc/doc/configfiles.texi
index c6c60bbe802..f24b85d719a 100644
--- a/gcc/doc/configfiles.texi
+++ b/gcc/doc/configfiles.texi
@@ -50,7 +50,7 @@ the files listed in @code{outputs} there are also generated.
The following configuration headers are created from the Makefile,
using @file{mkconfig.sh}, rather than directly by @file{configure}.
-@file{config.h}, @file{hconfig.h} and @file{tconfig.h} all contain the
+@file{config.h}, @file{bconfig.h} and @file{tconfig.h} all contain the
@file{xm-@var{machine}.h} header, if any, appropriate to the host,
build and target machines respectively, the configuration headers for
the target, and some definitions; for the host and build machines,
@@ -63,7 +63,7 @@ these include the autoconfigured headers generated by
@item
@file{config.h}, for use in programs that run on the host machine.
@item
-@file{hconfig.h}, for use in programs that run on the build machine.
+@file{bconfig.h}, for use in programs that run on the build machine.
@item
@file{tconfig.h}, for use in programs and libraries for the target
machine.
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 9a0f04cb0af..edf621283cc 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -4570,6 +4570,21 @@ v4si f (v4si a, v4si b, v4si c)
@findex strrchr
@findex strspn
@findex strstr
+@findex floor
+@findex floorf
+@findex floorl
+@findex ceil
+@findex ceilf
+@findex ceill
+@findex round
+@findex roundf
+@findex roundl
+@findex trunc
+@findex truncf
+@findex truncl
+@findex nearbyint
+@findex nearbyintf
+@findex nearbyintl
GCC provides a large number of built-in functions other than the ones
mentioned above. Some of these are for internal use in the processing
@@ -4605,28 +4620,29 @@ built-in functions. All these functions have corresponding versions
prefixed with @code{__builtin_}, which may be used even in strict C89
mode.
-The ISO C99 functions @code{conj}, @code{conjf}, @code{conjl},
-@code{creal}, @code{crealf}, @code{creall}, @code{cimag}, @code{cimagf},
-@code{cimagl}, @code{llabs} and @code{imaxabs} are handled as built-in
-functions except in strict ISO C90 mode. There are also built-in
-versions of the ISO C99 functions @code{cosf}, @code{cosl},
-@code{expf}, @code{expl}, @code{fabsf}, @code{fabsl},
-@code{logf}, @code{logl}, @code{sinf}, @code{sinl}, @code{sqrtf}, and
-@code{sqrtl}, that are recognized in any mode since ISO C90 reserves
-these names for the purpose to which ISO C99 puts them. All these
-functions have corresponding versions prefixed with @code{__builtin_}.
+The ISO C99 functions @code{conj}, @code{conjf}, @code{conjl}, @code{creal},
+@code{crealf}, @code{creall}, @code{cimag}, @code{cimagf}, @code{cimagl},
+@code{llabs}, @code{imaxabs}, @code{round}, @code{trunc}, @code{nearbyint},
+@code{roundf}, @code{truncf}, @code{nearbyintf}, @code{roundl}, @code{truncl} and
+@code{nearbyintl} are handled as built-in functions except in strict ISO C90 mode.
+There are also built-in versions of the ISO C99 functions @code{cosf},
+@code{cosl}, @code{expf}, @code{expl}, @code{fabsf}, @code{fabsl}, @code{logf},
+@code{logl}, @code{sinf}, @code{sinl}, @code{sqrtf}, @code{sqrtl},
+@code{ceilf}, @code{ceill}, @code{floorf} and @code{floorl} that are recognized
+in any mode since ISO C90 reserves these names for the purpose to which ISO C99
+puts them. All these functions have corresponding versions prefixed with
+@code{__builtin_}.
The ISO C90 functions @code{abs}, @code{cos}, @code{exp}, @code{fabs},
-@code{fprintf}, @code{fputs}, @code{labs}, @code{log},
-@code{memcmp}, @code{memcpy},
-@code{memset}, @code{printf}, @code{sin}, @code{sqrt}, @code{strcat},
-@code{strchr}, @code{strcmp}, @code{strcpy}, @code{strcspn},
-@code{strlen}, @code{strncat}, @code{strncmp}, @code{strncpy},
-@code{strpbrk}, @code{strrchr}, @code{strspn}, and @code{strstr} are all
-recognized as built-in functions unless @option{-fno-builtin} is
-specified (or @option{-fno-builtin-@var{function}} is specified for an
-individual function). All of these functions have corresponding
-versions prefixed with @code{__builtin_}.
+@code{fprintf}, @code{fputs}, @code{labs}, @code{log}, @code{floor},
+@code{ceil} @code{memcmp}, @code{memcpy}, @code{memset}, @code{printf},
+@code{sin}, @code{sqrt}, @code{strcat}, @code{strchr}, @code{strcmp},
+@code{strcpy}, @code{strcspn}, @code{strlen}, @code{strncat}, @code{strncmp},
+@code{strncpy}, @code{strpbrk}, @code{strrchr}, @code{strspn}, and
+@code{strstr} are all recognized as built-in functions unless
+@option{-fno-builtin} is specified (or @option{-fno-builtin-@var{function}} is
+specified for an individual function). All of these functions have
+corresponding versions prefixed with @code{__builtin_}.
GCC provides built-in versions of the ISO C99 floating point comparison
macros that avoid raising exceptions for unordered operands. They have
diff --git a/gcc/doc/gcov.texi b/gcc/doc/gcov.texi
index 9c0ac11d420..e99d3ba00c9 100644
--- a/gcc/doc/gcov.texi
+++ b/gcc/doc/gcov.texi
@@ -389,114 +389,23 @@ many times the result was 1.
@node Gcov Data Files
@section Brief description of @command{gcov} data files
-@command{gcov} uses three files for doing profiling. The names of these
-files are derived from the original @emph{source} file by substituting
-the file suffix with either @file{.bb}, @file{.bbg}, or @file{.da}. All
-of these files are placed in the same directory as the source file, and
-contain data stored in a platform-independent method.
-
-The @file{.bb} and @file{.bbg} files are generated when the source file
-is compiled with the GCC @option{-ftest-coverage} option. The
-@file{.bb} file contains a list of source files (including headers),
-functions within those files, and line numbers corresponding to each
-basic block in the source file.
-
-The @file{.bb} file format consists of several lists of 4-byte integers
-which correspond to the line numbers of each basic block in the file.
-Each list is terminated by a line number of 0. A line number of
-@minus{}1 is used to designate that the source file name (padded to a
-4-byte boundary and followed by another @minus{}1) follows. In
-addition, a line number of @minus{}2 is used to designate that the name
-of a function (also padded to a 4-byte boundary and followed by a
-@minus{}2) follows.
-
-The @file{.bbg} file is used to reconstruct the program flow graph for
-the source file. It contains a list of the program flow arcs (possible
-branches taken from one basic block to another) for each function which,
-in combination with the @file{.bb} file, enables gcov to reconstruct the
-program flow.
-
-In the @file{.bbg} file, the format is:
-@smallexample
- name of function #0
- checksum of function #0
- number of basic blocks for function #0 (4-byte number)
- total number of arcs for function #0 (4-byte number)
- count of arcs in basic block #0 (4-byte number)
- destination basic block of arc #0 (4-byte number)
- flag bits (4-byte number)
- destination basic block of arc #1 (4-byte number)
- flag bits (4-byte number)
- @dots{}
- destination basic block of arc #N (4-byte number)
- flag bits (4-byte number)
- count of arcs in basic block #1 (4-byte number)
- destination basic block of arc #0 (4-byte number)
- flag bits (4-byte number)
- @dots{}
-@end smallexample
-
-A @minus{}1 (stored as a 4-byte number) is used to separate each function's
-list of basic blocks, and to verify that the file has been read
-correctly.
-
-The function name is stored as a @minus{}1 (4 bytes), the length (4 bytes),
-the name itself (padded to 4-byte boundary) followed by a @minus{}1 (4 bytes).
+@command{gcov} uses two files for profiling. The names of these files
+are derived from the original @emph{object} file by substituting the
+file suffix with either @file{.bbg}, or @file{.da}. All of these files
+are placed in the same directory as the object file, and contain data
+stored in a platform-independent format.
-The flags are defined as follows:
-@itemize
-@item bit0
-On function spanning tree
-
-@item bit1
-Is a fake edge
-
-@item bit2
-Is the fall through edge from one block to its immediate successor.
-
-@item bit3-bit31
-For future expansion
-
-@end itemize
+The @file{.bbg} files is generated when the source file is compiled with
+the GCC @option{-ftest-coverage} option. It contains information to
+reconstruct the basic block graphs and assign source line numbers to
+blocks.
The @file{.da} file is generated when a program containing object files
built with the GCC @option{-fprofile-arcs} option is executed. A
-separate @file{.da} file is created for each source file compiled with
-this option, and the name of the @file{.da} file is stored as an
-absolute pathname in the resulting object file. This path name is
-derived from the object file name by substituting a @file{.da} suffix.
-
-The @file{.da} consists of one or more blocks with the following
-structure:
-@smallexample
- "magic" number @minus{}123 (4-byte number)
- number of functions (4-byte number)
- length of the "extension block" in bytes
- extension block (variable length)
- name of function #0 (the same format as in .bbg file)
- checksum of function #0
- number of instrumented arcs (4-byte number)
- count of arc #0 (8-byte number)
- count of arc #1 (8-byte number)
- @dots{}
- count of arc #M_0 (8-byte number)
- name of function #1 (the same format as in .bbg file)
- checksum of function #1
- @dots{}
-@end smallexample
-Multiple program runs might merge data into a single block, or might
-append a new block. The current structure of the extension block is as
-follows:
-@smallexample
- number of instrumented arcs in whole program (4-byte number)
- sum all of instrumented arcs in whole program (8-byte number)
- maximal value of counter in whole program (8-byte number)
- number of instrumented arcs in the object file (4-byte number)
- sum all of instrumented arcs in the object file (8-byte number)
- maximal value of counter in the object file (8-byte number)
-@end smallexample
-
-All three of these files use the functions in @file{gcov-io.h} to store
-integers; the functions in this header provide a machine-independent
-mechanism for storing and retrieving data from a stream.
+separate @file{.da} file is created for each object file compiled with
+this option. It contains arc transition counts, and some summary
+information.
+The full details of the file format is specified in @file{gcov-io.h},
+and functions provided in that header file should be used to access the
+coverage files.
diff --git a/gcc/doc/install-old.texi b/gcc/doc/install-old.texi
index a322b631a92..8ac31f28a38 100644
--- a/gcc/doc/install-old.texi
+++ b/gcc/doc/install-old.texi
@@ -567,7 +567,7 @@ sources. If you must recompile, here is how:
@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{hconfig.h}. This procedure
+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}.
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index fd518693f5a..dd80b7fda02 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -890,8 +890,29 @@ forward to maintain the port.
Some options which only apply to building cross compilers:
@table @code
+@item --with-sysroot
+@itemx --with-sysroot=@var{dir}
+Tells GCC to consider @var{dir} as the root of a tree that contains a
+(subset of) the root filesystem of the target operating system.
+Target system headers, libraries and run-time object files will be
+searched in there. The specified directory is not copied into the
+install tree, unlike the options @option{--with-headers} and
+@option{--with-libs} that this option obsoletes. The default value,
+in case @option{--with-sysroot} is not given an argument, is
+@option{$@{gcc_tooldir@}/sys-root}. Starting the pathname with
+@option{$@{gcc_tooldir@}/}, in such a way that this variable is not
+expanded by the shell, but rather by the gcc Makefile, enables the
+target sysroot directory to be relocatable along with the entire
+install tree, but it will require the gcc tool directory to be created
+@emph{before} the build is started. This directory, as well as its
+intermediate pathnames, can be easily created by running @command{make
+install-gcc-tooldir} the gcc build directory. This is not done
+automatically to avoid touching the install tree without explicit
+permission.
+
@item --with-headers
@itemx --with-headers=@var{dir}
+Deprecated in favor of @option{--with-sysroot}.
Specifies that target headers are available when building a cross compiler.
The @var{dir} argument specifies a directory which has the target include
files. These include files will be copied into the @file{gcc} install
@@ -902,6 +923,7 @@ pre-exist, the @var{dir} argument may be omitted. @command{fixincludes}
will be run on these files to make them compatible with GCC.
@item --with-libs
@itemx --with-libs=``@var{dir1} @var{dir2} @dots{} @var{dirN}''
+Deprecated in favor of @option{--with-sysroot}.
Specifies a list of directories which contain the target runtime
libraries. These libraries will be copied into the @file{gcc} install
directory. If the directory list is omitted, this option has no
@@ -1702,6 +1724,8 @@ GNU Compiler Collection on your machine.
@item
@uref{#vax-dec-ultrix,,vax-dec-ultrix}
@item
+@uref{#*-*-vxworks*,,*-*-vxworks*}
+@item
@uref{#xtensa-*-elf,,xtensa-*-elf}
@item
@uref{#xtensa-*-linux*,,xtensa-*-linux*}
@@ -3208,6 +3232,41 @@ in some cases (for example, when @code{alloca} is used).
@html
<hr />
@end html
+@heading @anchor{*-*-vxworks*}*-*-vxworks*
+Support for VxWorks is in flux. At present GCC supports @emph{only} the
+very recent VxWorks 5.5 (aka Tornado 2.2) release, and only on PowerPC.
+We welcome patches for other architectures supported by VxWorks 5.5.
+Support for VxWorks AE would also be welcome; we believe this is merely
+a matter of writing an appropriate ``configlette'' (see below). We are
+not interested in supporting older, a.out or COFF-based, versions of
+VxWorks in GCC 3.
+
+VxWorks comes with an older version of GCC installed in
+@file{@var{$WIND_BASE}/host}; we recommend you do not overwrite it.
+Choose an installation @var{prefix} entirely outside @var{$WIND_BASE}.
+Before running @command{configure}, create the directories @file{@var{prefix}}
+and @file{@var{prefix}/bin}. Link or copy the appropriate assembler,
+linker, etc. into @file{@var{prefix}/bin}, and set your @var{PATH} to
+include that directory while running both @command{configure} and
+@command{make}.
+
+You must give @command{configure} the
+@option{--with-headers=@var{$WIND_BASE}/target/h} switch so that it can
+find the VxWorks system headers. Since VxWorks is a cross compilation
+target only, you must also specify @option{--target=@var{target}}.
+@command{configure} will attempt to create the directory
+@file{@var{prefix}/@var{target}/sys-include} and copy files into it;
+make sure the user running @command{configure} has sufficient privilege
+to do so.
+
+GCC's exception handling runtime requires a special ``configlette''
+module, @file{contrib/gthr_supp_vxw_5x.c}. Follow the instructions in
+that file to add the module to your kernel build. (Future versions of
+VxWorks will incorporate this module.)
+
+@html
+<hr />
+@end html
@heading @anchor{xtensa-*-elf}xtensa-*-elf
This target is intended for embedded Xtensa systems using the
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index fe214602a1e..c7ddb721bec 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -305,12 +305,12 @@ in the following sections.
-iprefix @var{file} -iwithprefix @var{dir} @gol
-iwithprefixbefore @var{dir} -isystem @var{dir} @gol
-M -MM -MF -MG -MP -MQ -MT -nostdinc -P -remap @gol
--trigraphs -undef -U@var{macro} -Wp,@var{option}}
+-trigraphs -undef -U@var{macro} -Wp,@var{option} -Xpreprocessor @var{option}}
@item Assembler Option
@xref{Assembler Options,,Passing Options to the Assembler}.
@gccoptlist{
--Wa,@var{option}}
+-Wa,@var{option} -Xassembler @var{option}}
@item Linker Options
@xref{Link Options,,Options for Linking}.
@@ -4310,6 +4310,7 @@ Some of these options make sense only together with @option{-E} because
they cause the preprocessor output to be unsuitable for actual
compilation.
+@table @gcctabopt
@opindex Wp
You can use @option{-Wp,@var{option}} to bypass the compiler driver
and pass @var{option} directly through to the preprocessor. If
@@ -4321,6 +4322,16 @@ interface is undocumented and subject to change, so whenever possible
you should avoid using @option{-Wp} and let the driver handle the
options instead.
+@item -Xpreprocessor @var{option}
+@opindex preprocessor
+Pass @var{option} as an option to the preprocessor. You can use this to
+supply system-specific preprocessor options which GCC does not know how to
+recognize.
+
+If you want to pass an option that takes an argument, you must use
+@option{-Xpreprocessor} twice, once for the option and once for the argument.
+@end table
+
@include cppopts.texi
@node Assembler Options
@@ -4334,6 +4345,16 @@ You can pass options to the assembler.
@opindex Wa
Pass @var{option} as an option to the assembler. If @var{option}
contains commas, it is split into multiple options at the commas.
+
+@item -Xassembler @var{option}
+@opindex Xassembler
+Pass @var{option} as an option to the assembler. You can use this to
+supply system-specific assembler options which GCC does not know how to
+recognize.
+
+If you want to pass an option that takes an argument, you must use
+@option{-Xassembler} twice, once for the option and once for the argument.
+
@end table
@node Link Options
@@ -4846,13 +4867,22 @@ for each @samp{%g.s} and another for each @samp{%U.s}. Previously, @samp{%U} wa
simply substituted with a file name chosen for the previous @samp{%u},
without regard to any appended suffix.
-@item %j@var{SUFFIX}
+@item %j@var{suffix}
Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
writable, and if save-temps is off; otherwise, substitute the name
of a temporary file, just like @samp{%u}. This temporary file is not
meant for communication between processes, but rather as a junk
disposal mechanism.
+@item %|@var{suffix}
+@itemx %m@var{suffix}
+Like @samp{%g}, except if @option{-pipe} is in effect. In that case
+@samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
+all. These are the two most common ways to instruct a program that it
+should read from standard input or write to standard output. If you
+need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
+construct: see for example @file{f/lang-specs.h}.
+
@item %.@var{SUFFIX}
Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
when it is subsequently output with @samp{%*}. @var{SUFFIX} is
@@ -4903,9 +4933,6 @@ the full name found.
Print @var{str} as an error message. @var{str} is terminated by a newline.
Use this when inconsistent options are detected.
-@item %|
-Output @samp{-} if the input for the current command is coming from a pipe.
-
@item %(@var{name})
Substitute the contents of spec string @var{name} at this point.
@@ -5002,6 +5029,12 @@ Substitute the variable part of a matched option. See below.
Note that each comma in the substituted string is replaced by
a single space.
+@item %<@code{S}
+Remove all occurrences of @code{-S} from the command line. Note---this
+command is position dependent. @samp{%} commands in the spec string
+before this one will see @code{-S}, @samp{%} commands in the spec string
+after this one will not.
+
@item %:@var{function}(@var{args})
Call the named function @var{function}, passing it @var{args}.
@var{args} is first processed as a nested spec string, then split
@@ -5056,51 +5089,40 @@ GCC considers @option{-o foo} as being
one switch whose names starts with @samp{o}. %@{o*@} would substitute this
text, including the space. Thus two arguments would be generated.
-@item %@{^@code{S}*@}
-Like %@{@code{S}*@}, but don't put a blank between a switch and its
-argument. Thus %@{^o*@} would only generate one argument, not two.
-
@item %@{@code{S}*&@code{T}*@}
Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
(the order of @code{S} and @code{T} in the spec is not significant).
There can be any number of ampersand-separated variables; for each the
wild card is optional. Useful for CPP as @samp{%@{D*&U*&A*@}}.
-@item %@{<@code{S}@}
-Remove all occurrences of @code{-S} from the command line. Note---this
-command is position dependent. @samp{%} commands in the spec string
-before this option will see @code{-S}, @samp{%} commands in the spec
-string after this option will not.
-
-@item %@{@code{S}*:@code{X}@}
-Substitutes @code{X} if one or more switches whose names start with
-@code{-S} are specified to GCC@. Note that the tail part of the
-@code{-S} option (i.e.@: the part matched by the @samp{*}) will be substituted
-for each occurrence of @samp{%*} within @code{X}.
-
@item %@{@code{S}:@code{X}@}
-Substitutes @code{X}, but only if the @samp{-S} switch was given to GCC@.
+Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
@item %@{!@code{S}:@code{X}@}
-Substitutes @code{X}, but only if the @samp{-S} switch was @emph{not} given to GCC@.
-
-@item %@{|@code{S}:@code{X}@}
-Like %@{@code{S}:@code{X}@}, but if no @code{S} switch, substitute @samp{-}.
+Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
-@item %@{|!@code{S}:@code{X}@}
-Like %@{!@code{S}:@code{X}@}, but if there is an @code{S} switch, substitute @samp{-}.
+@item %@{@code{S}*:@code{X}@}
+Substitutes @code{X} if one or more switches whose names start with
+@code{-S} are specified to GCC@. Normally @code{X} is substituted only
+once, no matter how many such switches appeared. However, if @code{%*}
+appears somewhere in @code{X}, then @code{X} will be substituted once
+for each matching switch, with the @code{%*} replaced by the part of
+that switch that matched the @code{*}.
@item %@{.@code{S}:@code{X}@}
-Substitutes @code{X}, but only if processing a file with suffix @code{S}.
+Substitutes @code{X}, if processing a file with suffix @code{S}.
@item %@{!.@code{S}:@code{X}@}
-Substitutes @code{X}, but only if @emph{not} processing a file with suffix @code{S}.
+Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
@item %@{@code{S}|@code{P}:@code{X}@}
-Substitutes @code{X} if either @code{-S} or @code{-P} was given to GCC@. This may be
-combined with @samp{!} and @samp{.} sequences as well, although they
-have a stronger binding than the @samp{|}. For example a spec string
-like this:
+Substitutes @code{X} if either @code{-S} or @code{-P} was given to GCC@.
+This may be combined with @samp{!}, @samp{.}, and @code{*} sequences as well,
+although they have a stronger binding than the @samp{|}. If @code{%*}
+appears in @code{X}, all of the alternatives must be starred, and only
+the first matching alternative is substituted.
+
+For example, a spec string like this:
@smallexample
%@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
@@ -5116,23 +5138,33 @@ jim.d -bar -boggle
-d jim.d -bar -baz -boggle
@end smallexample
+@item %@{S:X; T:Y; :D@}
+
+If @code{S} was given to GCC, substitues @code{X}; else if @code{T} was
+given to GCC, substitues @code{Y}; else substitutes @code{D}. There can
+be as many clauses as you need. This may be combined with @code{.},
+@code{!}, @code{|}, and @code{*} as needed.
+
+
@end table
-The conditional text @code{X} in a %@{@code{S}:@code{X}@} or
-%@{!@code{S}:@code{X}@} construct may contain other nested @samp{%} constructs
-or spaces, or even newlines. They are processed as usual, as described
-above.
+The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
+construct may contain other nested @samp{%} constructs or spaces, or
+even newlines. They are processed as usual, as described above.
+Trailing white space in @code{X} is ignored. White space may also
+appear anywhere on the left side of the colon in these constructs,
+except between @code{.} or @code{*} and the corresponding word.
-The @option{-O}, @option{-f}, @option{-m}, and @option{-W}
-switches are handled specifically in these
-constructs. If another value of @option{-O} or the negated form of a @option{-f}, @option{-m}, or
-@option{-W} switch is found later in the command line, the earlier switch
-value is ignored, except with @{@code{S}*@} where @code{S} is just one
-letter, which passes all matching options.
+The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
+handled specifically in these constructs. If another value of
+@option{-O} or the negated form of a @option{-f}, @option{-m}, or
+@option{-W} switch is found later in the command line, the earlier
+switch value is ignored, except with @{@code{S}*@} where @code{S} is
+just one letter, which passes all matching options.
-The character @samp{|} at the beginning of the predicate text is used to indicate
-that a command should be piped to the following command, but only if @option{-pipe}
-is specified.
+The character @samp{|} at the beginning of the predicate text is used to
+indicate that a command should be piped to the following command, but
+only if @option{-pipe} is specified.
It is built into GCC which switches take arguments and which do not.
(You might think it would be useful to generalize this to allow each
@@ -7856,7 +7888,7 @@ for the ABI and the set of available instructions. The choices for
@samp{pentium}, @samp{pentium-mmx}, @samp{pentiumpro}, @samp{pentium2},
@samp{pentium3}, @samp{pentium4}, @samp{k6}, @samp{k6-2}, @samp{k6-3},
@samp{athlon}, @samp{athlon-tbird}, @samp{athlon-4}, @samp{athlon-xp},
-@samp{athlon-mp}, @samp{winchip-c6}, @samp{winchip2} and @samp{c3}.
+@samp{athlon-mp}, @samp{winchip-c6}, @samp{winchip2}, @samp{k8} and @samp{c3}.
While picking a specific @var{cpu-type} will schedule things appropriately
for that particular chip, the compiler will not generate any code that
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index 3ed88d02729..cafe001a6f0 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -2662,6 +2662,51 @@ corresponds to the C data type @code{double} and the @code{logf}
built-in function uses the mode which corresponds to the C data
type @code{float}.
+@cindex @code{floor@var{m}2} instruction pattern
+@item @samp{floor@var{m}2}
+Store the largest integral value not greater than argument.
+
+The @code{floor} built-in function of C always uses the mode which
+corresponds to the C data type @code{double} and the @code{floorf}
+built-in function uses the mode which corresponds to the C data
+type @code{float}.
+
+@cindex @code{trunc@var{m}2} instruction pattern
+@item @samp{trunc@var{m}2}
+Store the argument rounded to integer towards zero.
+
+The @code{trunc} built-in function of C always uses the mode which
+corresponds to the C data type @code{double} and the @code{truncf}
+built-in function uses the mode which corresponds to the C data
+type @code{float}.
+
+@cindex @code{round@var{m}2} instruction pattern
+@item @samp{round@var{m}2}
+Store the argument rounded to integer away from zero.
+
+The @code{round} built-in function of C always uses the mode which
+corresponds to the C data type @code{double} and the @code{roundf}
+built-in function uses the mode which corresponds to the C data
+type @code{float}.
+
+@cindex @code{ceil@var{m}2} instruction pattern
+@item @samp{ceil@var{m}2}
+Store the argument rounded to integer away from zero.
+
+The @code{ceil} built-in function of C always uses the mode which
+corresponds to the C data type @code{double} and the @code{ceilf}
+built-in function uses the mode which corresponds to the C data
+type @code{float}.
+
+@cindex @code{nearbyint@var{m}2} instruction pattern
+@item @samp{nearbyint@var{m}2}
+Store the argument rounded according to the default rounding mode
+
+The @code{nearbyint} built-in function of C always uses the mode which
+corresponds to the C data type @code{double} and the @code{nearbyintf}
+built-in function uses the mode which corresponds to the C data
+type @code{float}.
+
@cindex @code{ffs@var{m}2} instruction pattern
@item @samp{ffs@var{m}2}
Store into operand 0 one plus the index of the least significant 1-bit
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 4b885113797..12812bd0118 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -233,6 +233,19 @@ an example of this.
Do not define this macro if it does not need to do anything.
+@findex AS_NEEDS_DASH_FOR_PIPED_INPUT
+@item AS_NEEDS_DASH_FOR_PIPED_INPUT
+Define this macro, with no value, if the driver should give the assembler
+an argument consisting of a single dash, @option{-}, to instruct it to
+read from its standard input (which will be a pipe connected to the
+output of the compiler proper). This argument is given after any
+@option{-o} option specifying the name of the output file.
+
+If you do not define this macro, the assembler is assumed to read its
+standard input if given no non-option arguments. If your assembler
+cannot read standard input at all, use a @samp{%@{pipe:%e@}} construct;
+see @file{mips.h} for instance.
+
@findex LINK_SPEC
@item LINK_SPEC
A C string constant that tells the GCC driver program options to
@@ -4239,18 +4252,18 @@ the function prologue. Normally, the profiling code comes after.
@subsection Permitting tail calls
@cindex tail calls
-@table @code
-@findex FUNCTION_OK_FOR_SIBCALL
-@item FUNCTION_OK_FOR_SIBCALL (@var{decl})
-A C expression that evaluates to true if it is ok to perform a sibling
-call to @var{decl} from the current function.
+@deftypefn {Target Hook} bool TARGET_FUNCTION_OK_FOR_SIBCALL (tree @var{decl}, tree @var{exp})
+True if it is ok to do sibling call optimization for the specified
+call expression @var{exp}. @var{decl} will be the called function,
+or @code{NULL} if this is an indirect call.
It is not uncommon for limitations of calling conventions to prevent
tail calls to functions outside the current unit of translation, or
-during PIC compilation. Use this macro to enforce these restrictions,
+during PIC compilation. The hook is used to enforce these restrictions,
as the @code{sibcall} md pattern can not fail, or fall over to a
-``normal'' call.
-@end table
+``normal'' call. The criteria for successful sibling call optimization
+may vary greatly between different architectures.
+@end deftypefn
@node Varargs
@section Implementing the Varargs Macros
@@ -5413,6 +5426,15 @@ to clear a chunk of memory, or whether some other block clear mechanism
will be used. Defaults to 1 if @code{move_by_pieces_ninsns} returns less
than @code{CLEAR_RATIO}.
+@findex STORE_BY_PIECES_P
+@item STORE_BY_PIECES_P (@var{size}, @var{alignment})
+A C expression used to determine whether @code{store_by_pieces} will be
+used to set a chunk of memory to a constant value, or whether some other
+mechanism will be used. Used by @code{__builtin_memset} when storing
+values other than constant zero and by @code{__builtin_strcpy} when
+when called with a constant source string.
+Defaults to @code{MOVE_BY_PIECES_P}.
+
@findex USE_LOAD_POST_INCREMENT
@item USE_LOAD_POST_INCREMENT (@var{mode})
A C expression used to determine whether a load postincrement is a good
@@ -6267,7 +6289,7 @@ responsible for outputting the label definition at the proper place.
Here is how to do this:
@example
-ASM_OUTPUT_INTERNAL_LABEL (@var{file}, "LC", @var{labelno});
+@code{(*targetm.asm_out.internal_label)} (@var{file}, "LC", @var{labelno});
@end example
When you output a pool entry specially, you should end with a
@@ -6725,11 +6747,11 @@ This macro is not used by @code{output_asm_label}, or the @code{%l}
specifier that calls it; the intention is that this macro should be set
when it is necessary to output a label differently when its address is
being taken.
+@end table
-@findex ASM_OUTPUT_INTERNAL_LABEL
-@item ASM_OUTPUT_INTERNAL_LABEL (@var{stream}, @var{prefix}, @var{num})
-A C statement to output to the stdio stream @var{stream} a label whose
-name is made from the string @var{prefix} and the number @var{num}.
+@deftypefn {Target Hook} void TARGET_ASM_INTERNAL_LABEL (FILE *@var{stream}, const char *@var{prefix}, unsigned long @var{labelno})
+A function to output to the stdio stream @var{stream} a label whose
+name is made from the string @var{prefix} and the number @var{labelno}.
It is absolutely essential that these labels be distinct from the labels
used for user-level functions and variables. Otherwise, certain programs
@@ -6741,12 +6763,11 @@ should be excluded; on many systems, the letter @samp{L} at the
beginning of a label has this effect. You should find out what
convention your system uses, and follow it.
-The usual definition of this macro is as follows:
+The default version of this function utilizes ASM_GENERATE_INTERNAL_LABEL.
-@example
-fprintf (@var{stream}, "L%s%d:\n", @var{prefix}, @var{num})
-@end example
+@end deftypefn
+@table @code
@findex ASM_OUTPUT_DEBUG_LABEL
@item ASM_OUTPUT_DEBUG_LABEL (@var{stream}, @var{prefix}, @var{num})
A C statement to output to the stdio stream @var{stream} a debug info
@@ -6757,7 +6778,7 @@ systems, branch target labels must be at the beginning of instruction
bundles, but debug info labels can occur in the middle of instruction
bundles.
-If this macro is not defined, then @code{ASM_OUTPUT_INTERNAL_LABEL} will be
+If this macro is not defined, then @code{(*targetm.asm_out.internal_label)} will be
used.
@findex ASM_GENERATE_INTERNAL_LABEL
@@ -6766,7 +6787,7 @@ A C statement to store into the string @var{string} a label whose name
is made from the string @var{prefix} and the number @var{num}.
This string, when output subsequently by @code{assemble_name}, should
-produce the output that @code{ASM_OUTPUT_INTERNAL_LABEL} would produce
+produce the output that @code{(*targetm.asm_out.internal_label)} would produce
with the same @var{prefix} and @var{num}.
If the string begins with @samp{*}, then @code{assemble_name} will
@@ -6796,6 +6817,9 @@ conflict with the user's own symbols. Most assemblers allow periods
or percent signs in assembler symbols; putting at least one of these
between the name and the number will suffice.
+If this macro is not defined, a default definition will be provided
+which is correct for most systems.
+
@findex ASM_OUTPUT_DEF
@item ASM_OUTPUT_DEF (@var{stream}, @var{name}, @var{value})
A C statement to output to the stdio stream @var{stream} assembler code
@@ -7365,7 +7389,7 @@ A C statement to output to the stdio stream @var{stream} an assembler
pseudo-instruction to generate a difference between two labels.
@var{value} and @var{rel} are the numbers of two internal labels. The
definitions of these labels are output using
-@code{ASM_OUTPUT_INTERNAL_LABEL}, and they must be printed in the same
+@code{(*targetm.asm_out.internal_label)}, and they must be printed in the same
way here. For example,
@example
@@ -7387,7 +7411,7 @@ in a dispatch table are absolute.
The definition should be a C statement to output to the stdio stream
@var{stream} an assembler pseudo-instruction to generate a reference to
a label. @var{value} is the number of an internal label whose
-definition is output using @code{ASM_OUTPUT_INTERNAL_LABEL}.
+definition is output using @code{(*targetm.asm_out.internal_label)}.
For example,
@example
@@ -7398,7 +7422,7 @@ fprintf (@var{stream}, "\t.word L%d\n", @var{value})
@item ASM_OUTPUT_CASE_LABEL (@var{stream}, @var{prefix}, @var{num}, @var{table})
Define this if the label before a jump-table needs to be output
specially. The first three arguments are the same as for
-@code{ASM_OUTPUT_INTERNAL_LABEL}; the fourth argument is the
+@code{(*targetm.asm_out.internal_label)}; the fourth argument is the
jump-table which follows (a @code{jump_insn} containing an
@code{addr_vec} or @code{addr_diff_vec}).
@@ -7406,7 +7430,7 @@ This feature is used on system V to output a @code{swbeg} statement
for the table.
If this macro is not defined, these labels are output with
-@code{ASM_OUTPUT_INTERNAL_LABEL}.
+@code{(*targetm.asm_out.internal_label)}.
@findex ASM_OUTPUT_CASE_END
@item ASM_OUTPUT_CASE_END (@var{stream}, @var{num}, @var{table})
diff --git a/gcc/doloop.c b/gcc/doloop.c
index 67b742cde71..4f9eaff9cc2 100644
--- a/gcc/doloop.c
+++ b/gcc/doloop.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "flags.h"
#include "expr.h"
diff --git a/gcc/dominance.c b/gcc/dominance.c
index 1bba31fb57c..82562cfd49d 100644
--- a/gcc/dominance.c
+++ b/gcc/dominance.c
@@ -35,6 +35,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "hard-reg-set.h"
#include "basic-block.h"
diff --git a/gcc/dummy-conditions.c b/gcc/dummy-conditions.c
index 157f86bd639..02c55b2bf5f 100644
--- a/gcc/dummy-conditions.c
+++ b/gcc/dummy-conditions.c
@@ -18,8 +18,10 @@
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "gensupport.h"
/* MD generators that are run before insn-conditions.c exists should
diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c
index b5a87de8630..777ba8da71c 100644
--- a/gcc/dwarf2asm.c
+++ b/gcc/dwarf2asm.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "flags.h"
#include "tree.h"
#include "rtl.h"
@@ -285,11 +287,10 @@ int
size_of_uleb128 (value)
unsigned HOST_WIDE_INT value;
{
- int size = 0, byte;
+ int size = 0;
do
{
- byte = (value & 0x7f);
value >>= 7;
size += 1;
}
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 2e8fe614188..c93142069b3 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -36,6 +36,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "flags.h"
#include "real.h"
@@ -1976,7 +1978,7 @@ output_call_frame_info (for_eh)
&& !fde->uses_eh_lsda)
continue;
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, FDE_LABEL, for_eh + i * 2);
+ (*targetm.asm_out.internal_label) (asm_out_file, FDE_LABEL, for_eh + i * 2);
ASM_GENERATE_INTERNAL_LABEL (l1, FDE_AFTER_SIZE_LABEL, for_eh + i * 2);
ASM_GENERATE_INTERNAL_LABEL (l2, FDE_END_LABEL, for_eh + i * 2);
dw2_asm_output_delta (for_eh ? 4 : DWARF_OFFSET_SIZE, l2, l1,
@@ -3374,10 +3376,6 @@ struct file_table
/* Filenames referenced by this compilation unit. */
static struct file_table file_table;
-/* Local pointer to the name of the main input file. Initialized in
- dwarf2out_init. */
-static const char *primary_filename;
-
/* A pointer to the base of a table of references to DIE's that describe
declarations. The table is indexed by DECL_UID() which is a unique
number identifying each decl. */
@@ -7843,6 +7841,27 @@ is_base_type (type)
return 0;
}
+/* 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 (type)
+ tree type;
+{
+
+ if (TREE_CODE (type) == ERROR_MARK)
+ return BITS_PER_WORD;
+ else if (TYPE_SIZE (type) == NULL_TREE)
+ return 0;
+ else if (host_integerp (TYPE_SIZE (type), 1))
+ return tree_low_cst (TYPE_SIZE (type), 1);
+ else
+ return TYPE_ALIGN (type);
+}
+
/* Given a pointer to an arbitrary ..._TYPE tree node, return a debugging
entry that chains various modifiers in front of the given type. */
@@ -7920,7 +7939,8 @@ modified_type_die (type, is_const_type, is_volatile_type, context_die)
else if (code == POINTER_TYPE)
{
mod_type_die = new_die (DW_TAG_pointer_type, comp_unit_die, type);
- add_AT_unsigned (mod_type_die, DW_AT_byte_size, PTR_SIZE);
+ add_AT_unsigned (mod_type_die, DW_AT_byte_size,
+ simple_type_size_in_bits (type) / BITS_PER_UNIT);
#if 0
add_AT_unsigned (mod_type_die, DW_AT_address_class, 0);
#endif
@@ -7929,7 +7949,8 @@ modified_type_die (type, is_const_type, is_volatile_type, context_die)
else if (code == REFERENCE_TYPE)
{
mod_type_die = new_die (DW_TAG_reference_type, comp_unit_die, type);
- add_AT_unsigned (mod_type_die, DW_AT_byte_size, PTR_SIZE);
+ add_AT_unsigned (mod_type_die, DW_AT_byte_size,
+ simple_type_size_in_bits (type) / BITS_PER_UNIT);
#if 0
add_AT_unsigned (mod_type_die, DW_AT_address_class, 0);
#endif
@@ -8784,27 +8805,6 @@ simple_decl_align_in_bits (decl)
return (TREE_CODE (decl) != ERROR_MARK) ? DECL_ALIGN (decl) : 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 (type)
- tree type;
-{
-
- if (TREE_CODE (type) == ERROR_MARK)
- return BITS_PER_WORD;
- else if (TYPE_SIZE (type) == NULL_TREE)
- return 0;
- else if (host_integerp (TYPE_SIZE (type), 1))
- return tree_low_cst (TYPE_SIZE (type), 1);
- else
- return TYPE_ALIGN (type);
-}
-
/* Given a pointer to a FIELD_DECL, 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 determine what that offset is, either
@@ -12289,7 +12289,7 @@ dwarf2out_source_line (line, filename)
else if (DECL_SECTION_NAME (current_function_decl))
{
dw_separate_line_info_ref line_info;
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, SEPARATE_LINE_CODE_LABEL,
+ (*targetm.asm_out.internal_label) (asm_out_file, SEPARATE_LINE_CODE_LABEL,
separate_line_info_table_in_use);
/* expand the line info table if necessary */
@@ -12315,7 +12315,7 @@ dwarf2out_source_line (line, filename)
{
dw_line_info_ref line_info;
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, LINE_CODE_LABEL,
+ (*targetm.asm_out.internal_label) (asm_out_file, LINE_CODE_LABEL,
line_info_table_in_use);
/* Expand the line info table if necessary. */
@@ -12427,12 +12427,9 @@ dwarf2out_init (main_input_filename)
{
init_file_table ();
- /* Remember the name of the primary input file. */
- primary_filename = main_input_filename;
-
- /* Add it to the file table first, under the assumption that we'll
- be emitting line number data for it first, which avoids having
- to add an initial DW_LNS_set_file. */
+ /* Add the name of the primary input file to the file table first,
+ under the assumption that we'll be emitting line number data for
+ it first, which avoids having to add an initial DW_LNS_set_file. */
lookup_filename (main_input_filename);
/* Allocate the initial hunk of the decl_die_table. */
@@ -12637,7 +12634,7 @@ dwarf2out_finish (input_filename)
/* Output a terminator label for the .text section. */
text_section ();
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, TEXT_END_LABEL, 0);
+ (*targetm.asm_out.internal_label) (asm_out_file, TEXT_END_LABEL, 0);
/* Output the source line correspondence table. We must do this
even if there is no line information. Otherwise, on an empty
diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c
index bbbfcfcd718..e9a35bba441 100644
--- a/gcc/dwarfout.c
+++ b/gcc/dwarfout.c
@@ -563,9 +563,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
*/
#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#ifdef DWARF_DEBUGGING_INFO
-#include "system.h"
#include "dwarf.h"
#include "tree.h"
#include "flags.h"
@@ -1015,7 +1017,7 @@ static void retry_incomplete_types PARAMS ((void));
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 ASM_OUTPUT_INTERNAL_LABEL herein,
+ 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
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 0d9be17fe94..0099a50ee3c 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -37,6 +37,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "toplev.h"
#include "rtl.h"
#include "tree.h"
diff --git a/gcc/errors.c b/gcc/errors.c
index f3a3e9b76e7..02c272fc54d 100644
--- a/gcc/errors.c
+++ b/gcc/errors.c
@@ -24,6 +24,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "errors.h"
/* Set this to argv[0] at the beginning of main. */
diff --git a/gcc/et-forest.c b/gcc/et-forest.c
index 84594d44365..1cc3652d44e 100644
--- a/gcc/et-forest.c
+++ b/gcc/et-forest.c
@@ -25,6 +25,8 @@ Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "et-forest.h"
struct et_forest_occurrence;
diff --git a/gcc/except.c b/gcc/except.c
index c455d5208e3..fc7907df70a 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -49,6 +49,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
@@ -672,12 +674,12 @@ expand_start_catch (type_or_list)
void
expand_end_catch ()
{
- struct eh_region *try_region, *catch_region;
+ struct eh_region *try_region;
if (! doing_eh (0))
return;
- catch_region = expand_eh_region_end ();
+ expand_eh_region_end ();
try_region = cfun->eh->try_region;
emit_jump (try_region->u.try.continue_label);
@@ -3662,7 +3664,7 @@ output_function_exception_table ()
assemble_align (tt_format_size * BITS_PER_UNIT);
}
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LLSDA",
+ (*targetm.asm_out.internal_label) (asm_out_file, "LLSDA",
current_function_funcdef_no);
/* The LSDA header. */
diff --git a/gcc/explow.c b/gcc/explow.c
index b6caa521172..df5bcf659ef 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -22,6 +22,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "toplev.h"
#include "rtl.h"
#include "tree.h"
@@ -658,8 +660,7 @@ maybe_set_unchanging (ref, t)
first case, and decls with TREE_CONSTANT initializers in the second. */
if ((TREE_READONLY (t) && DECL_P (t)
&& (TREE_CODE (t) == PARM_DECL
- || DECL_INITIAL (t) == NULL_TREE
- || TREE_CONSTANT (DECL_INITIAL (t))))
+ || (DECL_INITIAL (t) && TREE_CONSTANT (DECL_INITIAL (t)))))
|| TREE_CODE_CLASS (TREE_CODE (t)) == 'c')
RTX_UNCHANGING_P (ref) = 1;
}
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 405e45f8089..dea2629733a 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -23,6 +23,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "toplev.h"
#include "rtl.h"
#include "tree.h"
diff --git a/gcc/expr.c b/gcc/expr.c
index e5f7ae51783..2d9403643ce 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "machmode.h"
#include "real.h"
#include "rtl.h"
@@ -227,6 +229,13 @@ static bool float_extend_from_mem[NUM_MACHINE_MODES][NUM_MACHINE_MODES];
(move_by_pieces_ninsns (SIZE, ALIGN) < (unsigned int) CLEAR_RATIO)
#endif
+/* This macro is used to determine whether store_by_pieces should be
+ called to "memset" storage with byte values other than zero, or
+ to "memcpy" storage when the source is a constant string. */
+#ifndef STORE_BY_PIECES_P
+#define STORE_BY_PIECES_P(SIZE, ALIGN) MOVE_BY_PIECES_P (SIZE, ALIGN)
+#endif
+
/* This array records the insn_code of insns to perform block moves. */
enum insn_code movstr_optab[NUM_MACHINE_MODES];
@@ -2648,7 +2657,7 @@ can_store_by_pieces (len, constfun, constfundata, align)
int reverse;
rtx cst;
- if (! MOVE_BY_PIECES_P (len, align))
+ if (! STORE_BY_PIECES_P (len, align))
return 0;
if (! SLOW_UNALIGNED_ACCESS (word_mode, align)
@@ -2723,7 +2732,7 @@ store_by_pieces (to, len, constfun, constfundata, align)
{
struct store_by_pieces data;
- if (! MOVE_BY_PIECES_P (len, align))
+ if (! STORE_BY_PIECES_P (len, align))
abort ();
to = protect_from_queue (to, 1);
data.constfun = constfun;
@@ -3905,7 +3914,6 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra,
else
{
rtx addr;
- rtx target = NULL_RTX;
rtx dest;
/* Push padding now if padding above and stack grows down,
@@ -3929,7 +3937,6 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra,
else
addr = memory_address (mode, gen_rtx_PLUS (Pmode, args_addr,
args_so_far));
- target = addr;
dest = gen_rtx_MEM (mode, addr);
if (type != 0)
{
@@ -4808,7 +4815,6 @@ store_constructor (exp, target, cleared, size)
enum machine_mode mode;
HOST_WIDE_INT bitsize;
HOST_WIDE_INT bitpos = 0;
- int unsignedp;
tree offset;
rtx to_rtx = target;
@@ -4826,7 +4832,6 @@ store_constructor (exp, target, cleared, size)
else
bitsize = -1;
- unsignedp = TREE_UNSIGNED (field);
mode = DECL_MODE (field);
if (DECL_BIT_FIELD (field))
mode = VOIDmode;
@@ -5047,7 +5052,7 @@ store_constructor (exp, target, cleared, size)
{
tree lo_index = TREE_OPERAND (index, 0);
tree hi_index = TREE_OPERAND (index, 1);
- rtx index_r, pos_rtx, hi_r, loop_top, loop_end;
+ rtx index_r, pos_rtx, loop_end;
struct nesting *loop;
HOST_WIDE_INT lo, hi, count;
tree position;
@@ -5086,8 +5091,7 @@ store_constructor (exp, target, cleared, size)
}
else
{
- hi_r = expand_expr (hi_index, NULL_RTX, VOIDmode, 0);
- loop_top = gen_label_rtx ();
+ expand_expr (hi_index, NULL_RTX, VOIDmode, 0);
loop_end = gen_label_rtx ();
unsignedp = TREE_UNSIGNED (domain);
@@ -6542,12 +6546,14 @@ expand_expr (exp, target, tmode, modifier)
/* 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
- cannot support. And exception is a CONSTRUCTOR into a multi-word
- MEM: that's much more likely to be most efficient into the MEM. */
+ cannot support. An exception is a CONSTRUCTOR into a multi-word
+ MEM: that's much more likely to be most efficient into the MEM.
+ Another is a CALL_EXPR which must return in memory. */
if (! cse_not_expected && mode != BLKmode && target
&& (GET_CODE (target) != REG || REGNO (target) < FIRST_PSEUDO_REGISTER)
- && ! (code == CONSTRUCTOR && GET_MODE_SIZE (mode) > UNITS_PER_WORD))
+ && ! (code == CONSTRUCTOR && GET_MODE_SIZE (mode) > UNITS_PER_WORD)
+ && ! (code == CALL_EXPR && aggregate_value_p (exp)))
target = subtarget;
switch (code)
@@ -6944,7 +6950,6 @@ expand_expr (exp, target, tmode, modifier)
case BIND_EXPR:
{
tree vars = TREE_OPERAND (exp, 0);
- int vars_need_expansion = 0;
/* Need to open a binding contour here because
if there are any cleanups they must be contained here. */
@@ -6959,10 +6964,7 @@ expand_expr (exp, target, tmode, modifier)
while (vars)
{
if (!DECL_RTL_SET_P (vars))
- {
- vars_need_expansion = 1;
- expand_decl (vars);
- }
+ expand_decl (vars);
expand_decl_init (vars);
vars = TREE_CHAIN (vars);
}
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog
index 8b378cf0f1a..16719e0f500 100644
--- a/gcc/f/ChangeLog
+++ b/gcc/f/ChangeLog
@@ -1,8 +1,28 @@
+2002-12-15 Zack Weinberg <zack@codesourcery.com>
+
+ * target.h: Don't define HOST_WIDE_INT.
+
+2002-12-02 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * Make-lang.in, ansify.c, intdoc.c, proj.h: Replace hconfig.h with
+ bconfig.h.
+ * fini.c, proj.h: Replace USE_HCONFIG with USE_BCONFIG
+
+2002-11-30 Zack Weinberg <zack@codesourcery.com>
+
+ * proj.h, ansify.c, g77spec.c, intdoc.c:
+ Include coretypes.h and tm.h.
+ * Make-lang.in: Update dependencies.
+
2002-11-20 Toon Moene <toon@moene.indiv.nluug.nl>
* invoke.texi: Explain the purpose of -fmove-all-movables,
-freduce-all-givs and -frerun-loop-opts better.
+2002-11-19 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * Make-lang.in: Correct BUILD/HOST confusion.
+
2002-11-19 Toon Moene <toon@moene.indiv.nluug.nl>
PR fortran/8587
@@ -31,7 +51,7 @@
2002-10-15 Richard Henderson <rth@redhat.com>
- * target.h (ffetarget_print_real1, ffetarget_print_real2): Use
+ * target.h (ffetarget_print_real1, ffetarget_print_real2): Use
real_to_decimal directly, and with the new arguments.
2002-09-23 Zack Weinberg <zack@codesourcery.com>
diff --git a/gcc/f/Make-lang.in b/gcc/f/Make-lang.in
index df31b1a6168..9c2e6340119 100644
--- a/gcc/f/Make-lang.in
+++ b/gcc/f/Make-lang.in
@@ -65,7 +65,7 @@ F77 f77: f771$(exeext)
f77.extraclean f77.maintainer-clean f77.rebuilt \
f77.stage1 f77.stage2 f77.stage3 f77.stage4
-g77spec.o: $(srcdir)/f/g77spec.c $(SYSTEM_H) $(GCC_H) \
+g77spec.o: $(srcdir)/f/g77spec.c $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) \
$(CONFIG_H)
(SHLIB_LINK='$(SHLIB_LINK)' \
SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
@@ -125,12 +125,12 @@ f/str-op.h f/str-op.j: f/fini$(build_exeext) f/str-op.fin
f/str-ot.h f/str-ot.j: f/fini$(build_exeext) f/str-ot.fin
./f/fini$(build_exeext) $(srcdir)/f/str-ot.fin f/str-ot.j f/str-ot.h
-f/fini$(build_exeext): f/fini.o $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o f/fini$(build_exeext) \
- f/fini.o $(HOST_LIBS)
+f/fini$(build_exeext): f/fini.o $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o f/fini$(build_exeext) \
+ f/fini.o $(BUILD_LIBS)
f/fini.o:
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
-c $(srcdir)/f/fini.c $(OUTPUT_OPTION)
gt-f-lex.h gt-f-where.h gt-f-com.h gt-f-ste.h gtype-f.h : s-gtype; @true
@@ -209,17 +209,17 @@ $(srcdir)/f/intdoc.texi: $(INTDOC_DEPS) $(srcdir)/f/intdoc.in
$(MAKE) f/intdoc$(build_exeext)
f/intdoc$(build_exeext) > $(srcdir)/f/intdoc.texi
-f/intdoc$(build_exeext): $(INTDOC_DEPS) f/intdoc.h0 hconfig.h $(SYSTEM_H) \
- $(HOST_LIBDEPS)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) $(INCLUDES) \
- $(srcdir)/f/intdoc.c $(HOST_LIBS) -o f/intdoc$(build_exeext)
+f/intdoc$(build_exeext): $(INTDOC_DEPS) f/intdoc.h0 bconfig.h \
+ $(SYSTEM_H) coretypes.h $(TM_H) $(BUILD_LIBDEPS)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) $(INCLUDES) \
+ $(srcdir)/f/intdoc.c $(BUILD_LIBS) -o f/intdoc$(build_exeext)
f/intdoc.h0: f/intdoc.in f/ansify$(build_exeext)
f/ansify$(build_exeext) $(srcdir)/f/intdoc.in \
< $(srcdir)/f/intdoc.in > f/intdoc.h0
-f/ansify$(build_exeext): f/ansify.c hconfig.h $(SYSTEM_H)
- $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) $(INCLUDES) \
+f/ansify$(build_exeext): f/ansify.c bconfig.h $(SYSTEM_H) coretypes.h $(TM_H)
+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) $(INCLUDES) \
$(srcdir)/f/ansify.c -o f/ansify$(build_exeext)
$(srcdir)/f/BUGS: f/bugs0.texi f/bugs.texi f/root.texi
@@ -350,178 +350,187 @@ f/bad.o: f/bad.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/bad.h f/bad.def f/where.h \
f/bld-op.def f/bit.h f/info.h f/info-b.def f/info-k.def f/info-w.def \
f/target.h f/lex.h f/type.h f/intrin.h f/intrin.def f/lab.h f/symbol.h \
f/symbol.def f/equiv.h f/storag.h f/global.h f/name.h toplev.h intl.h \
- diagnostic.h
+ diagnostic.h coretypes.h $(TM_H)
f/bit.o: f/bit.c f/proj.h $(CONFIG_H) $(SYSTEM_H) glimits.h f/bit.h \
- f/malloc.h
+ f/malloc.h coretypes.h $(TM_H)
f/bld.o: f/bld.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/bld.h f/bld-op.def f/bit.h \
f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def \
f/info-w.def f/target.h f/bad.h f/bad.def f/where.h glimits.h f/top.h f/lex.h \
f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def f/equiv.h f/global.h \
- f/name.h f/intrin.h f/intrin.def real.h
+ f/name.h f/intrin.h f/intrin.def real.h coretypes.h $(TM_H)
f/com.o: f/com.c f/proj.h $(CONFIG_H) $(SYSTEM_H) flags.h $(RTL_H) $(TREE_H) \
output.h convert.h f/com.h f/com-rt.def f/bld.h f/bld-op.def f/bit.h \
f/malloc.h f/info.h f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h \
f/bad.def f/where.h glimits.h f/top.h f/lex.h f/type.h f/intrin.h \
f/intrin.def f/lab.h f/symbol.h f/symbol.def f/equiv.h f/storag.h f/global.h \
f/name.h f/expr.h f/implic.h f/src.h f/st.h $(GGC_H) toplev.h diagnostic.h \
- $(LANGHOOKS_DEF) langhooks.h intl.h real.h debug.h gt-f-com.h gtype-f.h
+ $(LANGHOOKS_DEF) langhooks.h intl.h real.h debug.h gt-f-com.h gtype-f.h \
+ coretypes.h $(TM_H)
f/data.o: f/data.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/data.h f/bld.h f/bld-op.def \
f/bit.h f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def \
f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def f/where.h glimits.h \
f/top.h f/lex.h f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def f/equiv.h \
- f/global.h f/name.h f/intrin.h f/intrin.def f/expr.h f/st.h
+ f/global.h f/name.h f/intrin.h f/intrin.def f/expr.h f/st.h coretypes.h $(TM_H)
f/equiv.o: f/equiv.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/equiv.h f/bld.h \
f/bld-op.def f/bit.h f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h \
f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def f/where.h \
glimits.h f/top.h f/lex.h f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def \
- f/global.h f/name.h f/intrin.h f/intrin.def f/data.h
+ f/global.h f/name.h f/intrin.h f/intrin.def f/data.h coretypes.h $(TM_H)
f/expr.o: f/expr.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/expr.h f/bld.h f/bld-op.def \
f/bit.h f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def \
f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def f/where.h glimits.h \
f/top.h f/lex.h f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def f/equiv.h \
f/global.h f/name.h f/intrin.h f/intrin.def f/implic.h f/src.h f/st.h \
- f/stamp-str real.h
-f/fini.o: f/fini.c f/proj.h hconfig.h $(SYSTEM_H) f/malloc.h
+ f/stamp-str real.h coretypes.h $(TM_H)
+f/fini.o: f/fini.c f/proj.h bconfig.h $(SYSTEM_H) f/malloc.h coretypes.h $(TM_H)
f/global.o: f/global.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/global.h f/info.h \
f/info-b.def f/info-k.def f/info-w.def f/target.h $(TREE_H) f/bad.h f/bad.def \
f/where.h glimits.h f/top.h f/malloc.h f/lex.h f/type.h f/name.h f/symbol.h \
f/symbol.def f/bld.h f/bld-op.def f/bit.h f/com.h f/com-rt.def f/lab.h \
- f/storag.h f/intrin.h f/intrin.def f/equiv.h
+ f/storag.h f/intrin.h f/intrin.def f/equiv.h coretypes.h $(TM_H)
f/implic.o: f/implic.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/implic.h f/info.h \
f/info-b.def f/info-k.def f/info-w.def f/target.h $(TREE_H) f/bad.h f/bad.def \
f/where.h glimits.h f/top.h f/malloc.h f/lex.h f/type.h f/symbol.h \
f/symbol.def f/bld.h f/bld-op.def f/bit.h f/com.h f/com-rt.def f/lab.h \
- f/storag.h f/intrin.h f/intrin.def f/equiv.h f/global.h f/name.h f/src.h
+ f/storag.h f/intrin.h f/intrin.def f/equiv.h f/global.h f/name.h f/src.h \
+ coretypes.h $(TM_H)
f/info.o: f/info.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/info.h f/info-b.def \
f/info-k.def f/info-w.def f/target.h $(TREE_H) f/bad.h f/bad.def f/where.h \
- glimits.h f/top.h f/malloc.h f/lex.h f/type.h
+ glimits.h f/top.h f/malloc.h f/lex.h f/type.h coretypes.h $(TM_H)
f/intrin.o: f/intrin.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/intrin.h \
f/intrin.def f/bld.h f/bld-op.def f/bit.h f/malloc.h f/com.h f/com-rt.def \
$(TREE_H) f/info.h f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h \
f/bad.def f/where.h glimits.h f/top.h f/lex.h f/type.h f/lab.h f/storag.h \
- f/symbol.h f/symbol.def f/equiv.h f/global.h f/name.h f/expr.h f/src.h
+ f/symbol.h f/symbol.def f/equiv.h f/global.h f/name.h f/expr.h f/src.h \
+ coretypes.h $(TM_H)
f/lab.o: f/lab.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/lab.h f/com.h f/com-rt.def \
$(TREE_H) f/bld.h f/bld-op.def f/bit.h f/malloc.h f/info.h f/info-b.def \
f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def f/where.h glimits.h \
f/top.h f/lex.h f/type.h f/intrin.h f/intrin.def f/symbol.h f/symbol.def \
- f/equiv.h f/storag.h f/global.h f/name.h
+ f/equiv.h f/storag.h f/global.h f/name.h coretypes.h $(TM_H)
f/lex.o: f/lex.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/top.h f/malloc.h f/where.h \
glimits.h f/bad.h f/bad.def f/com.h f/com-rt.def $(TREE_H) f/bld.h \
f/bld-op.def f/bit.h f/info.h f/info-b.def f/info-k.def f/info-w.def \
f/target.h f/lex.h f/type.h f/intrin.h f/intrin.def f/lab.h f/symbol.h \
f/symbol.def f/equiv.h f/storag.h f/global.h f/name.h f/src.h flags.h \
- debug.h input.h toplev.h output.h $(GGC_H) gt-f-lex.h
-f/malloc.o: f/malloc.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/malloc.h
+ debug.h input.h toplev.h output.h $(GGC_H) gt-f-lex.h coretypes.h $(TM_H)
+f/malloc.o: f/malloc.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/malloc.h \
+ coretypes.h $(TM_H)
f/name.o: f/name.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/bad.h f/bad.def f/where.h \
glimits.h f/top.h f/malloc.h f/name.h f/global.h f/info.h f/info-b.def \
f/info-k.def f/info-w.def f/target.h $(TREE_H) f/lex.h f/type.h f/symbol.h \
f/symbol.def f/bld.h f/bld-op.def f/bit.h f/com.h f/com-rt.def f/lab.h \
- f/storag.h f/intrin.h f/intrin.def f/equiv.h f/src.h
+ f/storag.h f/intrin.h f/intrin.def f/equiv.h f/src.h coretypes.h $(TM_H)
f/parse.o: f/parse.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/top.h f/malloc.h \
f/where.h glimits.h f/com.h f/com-rt.def $(TREE_H) f/bld.h f/bld-op.def \
f/bit.h f/info.h f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h \
f/bad.def f/lex.h f/type.h f/intrin.h f/intrin.def f/lab.h f/symbol.h \
- f/symbol.def f/equiv.h f/storag.h f/global.h f/name.h version.h flags.h
+ f/symbol.def f/equiv.h f/storag.h f/global.h f/name.h version.h flags.h \
+ coretypes.h $(TM_H)
f/src.o: f/src.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/src.h f/bad.h f/bad.def \
- f/where.h glimits.h f/top.h f/malloc.h
+ f/where.h glimits.h f/top.h f/malloc.h coretypes.h $(TM_H)
f/st.o: f/st.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/st.h f/bad.h f/bad.def \
f/where.h glimits.h f/top.h f/malloc.h f/lex.h f/symbol.h f/symbol.def \
f/bld.h f/bld-op.def f/bit.h f/com.h f/com-rt.def $(TREE_H) f/info.h \
f/info-b.def f/info-k.def f/info-w.def f/target.h f/type.h f/lab.h \
f/storag.h f/intrin.h f/intrin.def f/equiv.h f/global.h f/name.h f/sta.h \
f/stamp-str f/stb.h f/expr.h f/stp.h f/stt.h f/stc.h f/std.h \
- f/stv.h f/stw.h f/ste.h f/sts.h f/stu.h
+ f/stv.h f/stw.h f/ste.h f/sts.h f/stu.h coretypes.h $(TM_H)
f/sta.o: f/sta.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/sta.h f/bad.h f/bad.def \
f/where.h glimits.h f/top.h f/malloc.h f/lex.h f/stamp-str f/symbol.h \
f/symbol.def f/bld.h f/bld-op.def f/bit.h f/com.h f/com-rt.def $(TREE_H) \
f/info.h f/info-b.def f/info-k.def f/info-w.def f/target.h f/type.h f/lab.h \
f/storag.h f/intrin.h f/intrin.def f/equiv.h f/global.h f/name.h f/implic.h \
- f/stb.h f/expr.h f/stp.h f/stt.h f/stc.h f/std.h f/stv.h f/stw.h
+ f/stb.h f/expr.h f/stp.h f/stt.h f/stc.h f/std.h f/stv.h f/stw.h coretypes.h \
+ $(TM_H)
f/stb.o: f/stb.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/stb.h f/bad.h f/bad.def \
f/where.h glimits.h f/top.h f/malloc.h f/expr.h f/bld.h f/bld-op.def f/bit.h \
f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def \
f/info-w.def f/target.h f/lex.h f/type.h f/lab.h f/storag.h f/symbol.h \
f/symbol.def f/equiv.h f/global.h f/name.h f/intrin.h f/intrin.def f/stp.h \
- f/stt.h f/stamp-str f/src.h f/sta.h f/stc.h
+ f/stt.h f/stamp-str f/src.h f/sta.h f/stc.h coretypes.h $(TM_H)
f/stc.o: f/stc.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/stc.h f/bad.h f/bad.def \
f/where.h glimits.h f/top.h f/malloc.h f/bld.h f/bld-op.def f/bit.h f/com.h \
f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def f/info-w.def \
f/target.h f/lex.h f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def \
f/equiv.h f/global.h f/name.h f/intrin.h f/intrin.def f/expr.h f/stp.h \
- f/stt.h f/stamp-str f/data.h f/implic.h f/src.h f/sta.h f/std.h f/stv.h f/stw.h
+ f/stt.h f/stamp-str f/data.h f/implic.h f/src.h f/sta.h f/std.h f/stv.h \
+ f/stw.h coretypes.h $(TM_H)
f/std.o: f/std.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/std.h f/bld.h f/bld-op.def \
f/bit.h f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def \
f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def f/where.h glimits.h \
f/top.h f/lex.h f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def f/equiv.h \
f/global.h f/name.h f/intrin.h f/intrin.def f/stp.h f/stt.h f/stamp-str \
- f/stv.h f/stw.h f/sta.h f/ste.h f/sts.h
+ f/stv.h f/stw.h f/sta.h f/ste.h f/sts.h coretypes.h $(TM_H)
f/ste.o: f/ste.c f/proj.h $(CONFIG_H) $(SYSTEM_H) $(RTL_H) toplev.h f/ste.h \
f/bld.h f/bld-op.def f/bit.h f/malloc.h f/com.h f/com-rt.def $(TREE_H) \
f/info.h f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def \
f/where.h glimits.h f/top.h f/lex.h f/type.h f/lab.h f/storag.h f/symbol.h \
f/symbol.def f/equiv.h f/global.h f/name.h f/intrin.h f/intrin.def f/stp.h \
f/stt.h f/stamp-str f/sts.h f/stv.h f/stw.h f/expr.h f/sta.h $(GGC_H) \
- gt-f-ste.h
+ gt-f-ste.h coretypes.h $(TM_H)
f/storag.o: f/storag.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/storag.h f/bld.h \
f/bld-op.def f/bit.h f/malloc.h f/com.h f/com-rt.def $(TREE_H) \
f/info.h f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h \
f/bad.def f/where.h glimits.h f/top.h f/lex.h f/type.h f/lab.h \
f/symbol.h f/symbol.def f/equiv.h f/global.h f/name.h f/intrin.h \
- f/intrin.def f/data.h
+ f/intrin.def f/data.h coretypes.h $(TM_H)
f/stp.o: f/stp.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/stp.h f/bld.h f/bld-op.def \
f/bit.h f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h \
f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def \
f/where.h glimits.h f/top.h f/lex.h f/type.h f/lab.h f/storag.h \
f/symbol.h f/symbol.def f/equiv.h f/global.h f/name.h f/intrin.h \
- f/intrin.def f/stt.h
+ f/intrin.def f/stt.h coretypes.h $(TM_H)
f/str.o: f/str.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/src.h f/bad.h f/bad.def \
- f/where.h glimits.h f/top.h f/malloc.h f/stamp-str f/lex.h
+ f/where.h glimits.h f/top.h f/malloc.h f/stamp-str f/lex.h coretypes.h $(TM_H)
f/sts.o: f/sts.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/sts.h f/malloc.h f/com.h \
f/com-rt.def $(TREE_H) f/bld.h f/bld-op.def f/bit.h f/info.h \
f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def \
f/where.h glimits.h f/top.h f/lex.h f/type.h f/intrin.h f/intrin.def \
f/lab.h f/symbol.h f/symbol.def f/equiv.h f/storag.h f/global.h \
- f/name.h
+ f/name.h coretypes.h $(TM_H)
f/stt.o: f/stt.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/stt.h f/top.h f/malloc.h \
f/where.h glimits.h f/bld.h f/bld-op.def f/bit.h f/com.h f/com-rt.def \
$(TREE_H) f/info.h f/info-b.def f/info-k.def f/info-w.def f/target.h \
f/bad.h f/bad.def f/lex.h f/type.h f/lab.h f/storag.h f/symbol.h \
f/symbol.def f/equiv.h f/global.h f/name.h f/intrin.h f/intrin.def \
- f/stp.h f/expr.h f/sta.h f/stamp-str
+ f/stp.h f/expr.h f/sta.h f/stamp-str coretypes.h $(TM_H)
f/stu.o: f/stu.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/bld.h f/bld-op.def f/bit.h \
f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def \
f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def f/where.h \
glimits.h f/top.h f/lex.h f/type.h f/lab.h f/storag.h f/symbol.h \
f/symbol.def f/equiv.h f/global.h f/name.h f/intrin.h f/intrin.def \
- f/implic.h f/stu.h f/sta.h f/stamp-str
+ f/implic.h f/stu.h f/sta.h f/stamp-str coretypes.h $(TM_H)
f/stv.o: f/stv.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/stv.h f/lab.h f/com.h \
f/com-rt.def $(TREE_H) f/bld.h f/bld-op.def f/bit.h f/malloc.h \
f/info.h f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h \
f/bad.def f/where.h glimits.h f/top.h f/lex.h f/type.h f/intrin.h \
f/intrin.def f/symbol.h f/symbol.def f/equiv.h f/storag.h f/global.h \
- f/name.h
+ f/name.h coretypes.h $(TM_H)
f/stw.o: f/stw.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/stw.h f/bld.h f/bld-op.def \
f/bit.h f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h \
f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def \
f/where.h glimits.h f/top.h f/lex.h f/type.h f/lab.h f/storag.h \
f/symbol.h f/symbol.def f/equiv.h f/global.h f/name.h f/intrin.h \
- f/intrin.def f/stv.h f/sta.h f/stamp-str
+ f/intrin.def f/stv.h f/sta.h f/stamp-str coretypes.h $(TM_H)
f/symbol.o: f/symbol.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/symbol.h \
f/symbol.def f/bld.h f/bld-op.def f/bit.h f/malloc.h f/com.h \
f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def \
f/info-w.def f/target.h f/bad.h f/bad.def f/where.h glimits.h f/top.h \
f/lex.h f/type.h f/lab.h f/storag.h f/intrin.h f/intrin.def f/equiv.h \
- f/global.h f/name.h f/src.h f/st.h
+ f/global.h f/name.h f/src.h f/st.h coretypes.h $(TM_H)
f/target.o: f/target.c f/proj.h $(CONFIG_H) $(SYSTEM_H) glimits.h f/target.h \
$(TREE_H) f/bad.h f/bad.def f/where.h f/top.h f/malloc.h f/info.h real.h \
- f/info-b.def f/info-k.def f/info-w.def f/type.h f/lex.h diagnostic.h
+ f/info-b.def f/info-k.def f/info-w.def f/type.h f/lex.h diagnostic.h \
+ coretypes.h $(TM_H)
f/top.o: f/top.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/top.h f/malloc.h f/where.h \
glimits.h f/bad.h f/bad.def f/bit.h f/bld.h f/bld-op.def f/com.h \
f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def \
f/info-w.def f/target.h f/lex.h f/type.h f/lab.h f/storag.h \
f/symbol.h f/symbol.def f/equiv.h f/global.h f/name.h f/intrin.h \
f/intrin.def f/data.h f/expr.h f/implic.h f/src.h f/st.h flags.h \
- toplev.h
-f/type.o: f/type.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/type.h f/malloc.h
-f/where.o: f/where.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/where.h glimits.h f/top.h \
- f/malloc.h f/lex.h $(GGC_H) gt-f-where.h
+ toplev.h coretypes.h $(TM_H)
+f/type.o: f/type.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/type.h f/malloc.h \
+ coretypes.h $(TM_H)
+f/where.o: f/where.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/where.h glimits.h \
+ f/top.h f/malloc.h f/lex.h $(GGC_H) gt-f-where.h coretypes.h $(TM_H)
diff --git a/gcc/f/ansify.c b/gcc/f/ansify.c
index ec9910779e7..84efb9664f3 100644
--- a/gcc/f/ansify.c
+++ b/gcc/f/ansify.c
@@ -19,8 +19,10 @@ along with GNU Fortran; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#define die_unless(c) \
do if (!(c)) \
diff --git a/gcc/f/fini.c b/gcc/f/fini.c
index 28d9028df13..5eeec66b905 100644
--- a/gcc/f/fini.c
+++ b/gcc/f/fini.c
@@ -19,7 +19,7 @@ along with GNU Fortran; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-#define USE_HCONFIG
+#define USE_BCONFIG
#include "proj.h"
#include "malloc.h"
diff --git a/gcc/f/g77spec.c b/gcc/f/g77spec.c
index 1bf20d266b4..3df50628539 100644
--- a/gcc/f/g77spec.c
+++ b/gcc/f/g77spec.c
@@ -46,6 +46,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "gcc.h"
#ifndef MATH_LIBRARY
diff --git a/gcc/f/intdoc.c b/gcc/f/intdoc.c
index fb88e88cecd..0ad83e4428e 100644
--- a/gcc/f/intdoc.c
+++ b/gcc/f/intdoc.c
@@ -22,8 +22,10 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* From f/proj.h, which uses #error -- not all C compilers
support that, and we want *this* program to be compilable
by pretty much any C compiler. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "assert.h"
/* Pull in the intrinsics info, but only the doc parts. */
diff --git a/gcc/f/lang-specs.h b/gcc/f/lang-specs.h
index 602028d136e..4331b743dfe 100644
--- a/gcc/f/lang-specs.h
+++ b/gcc/f/lang-specs.h
@@ -31,14 +31,14 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
{"@f77-cpp-input",
"cc1 -E -traditional-cpp -D_LANGUAGE_FORTRAN %(cpp_options) \
%{E|M|MM:%(cpp_debug_options)}\
- %{!M:%{!MM:%{!E:%{!pipe:%g.f} |\n\
- f771 %{!pipe:%g.f} %(cc1_options) %{I*} %{!fsyntax-only:%(invoke_as)}}}}", 0},
+ %{!M:%{!MM:%{!E: %|.f |\n\
+ f771 %|.f %(cc1_options) %{I*} %{!fsyntax-only:%(invoke_as)}}}}", 0},
{".r", "@ratfor", 0},
{"@ratfor",
"%{C:%{!E:%eGNU C does not support -C without using -E}}\
%{CC:%{!E:%eGNU C does not support -CC without using -E}}\
ratfor %{C} %{CC} %{v} %{E:%W{o*}} %{!E: %{!pipe:-o %g.f} %i |\n\
- f771 %{!pipe:%g.f} %(cc1_options) %{I*} %{!fsyntax-only:%(invoke_as)}}", 0},
+ f771 %m.f %(cc1_options) %{I*} %{!fsyntax-only:%(invoke_as)}}", 0},
{".f", "@f77", 0},
{".for", "@f77", 0},
{".FOR", "@f77", 0},
diff --git a/gcc/f/proj.h b/gcc/f/proj.h
index 8cf54c96a0d..0896bdf32c0 100644
--- a/gcc/f/proj.h
+++ b/gcc/f/proj.h
@@ -24,12 +24,14 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_F_PROJ_H
#define GCC_F_PROJ_H
-#ifdef USE_HCONFIG
-#include "hconfig.h"
+#ifdef USE_BCONFIG
+#include "bconfig.h"
#else
#include "config.h"
#endif
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#if (GCC_VERSION < 2000)
#error "You have to use gcc 2.x to build g77."
diff --git a/gcc/f/target.h b/gcc/f/target.h
index b96504f4628..971f8667ad9 100644
--- a/gcc/f/target.h
+++ b/gcc/f/target.h
@@ -30,13 +30,9 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_F_TARGET_H
#define GCC_F_TARGET_H
-#ifdef FFE_STANDALONE
-#define HOST_WIDE_INT long
-#else
#ifndef TREE_CODE
#include "tree.h"
#endif
-#endif
/* Simple definitions and enumerations. */
diff --git a/gcc/final.c b/gcc/final.c
index 312ae76f8fc..c0a13223b7f 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -46,6 +46,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
@@ -68,7 +70,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "target.h"
#include "debug.h"
#include "expr.h"
-#include "profile.h"
#include "cfglayout.h"
#ifdef XCOFF_DEBUGGING_INFO
@@ -136,10 +137,6 @@ static unsigned int insn_noperands;
static rtx last_ignored_compare = 0;
-/* Flag indicating this insn is the start of a new basic block. */
-
-static int new_block = 1;
-
/* Assign a unique number to each insn that is output.
This can be used to generate unique local labels. */
@@ -203,17 +200,6 @@ static char *line_note_exists;
rtx current_insn_predicate;
#endif
-struct function_list
-{
- struct function_list *next; /* next function */
- const char *name; /* function name */
- long cfg_checksum; /* function checksum */
- long count_edges; /* number of intrumented edges in this function */
-};
-
-static struct function_list *functions_head = 0;
-static struct function_list **functions_tail = &functions_head;
-
#ifdef HAVE_ATTR_length
static int asm_insn_count PARAMS ((rtx));
#endif
@@ -253,272 +239,6 @@ init_final (filename)
#endif
}
-/* Called at end of source file,
- to output the arc-profiling table for this entire compilation. */
-
-void
-end_final (filename)
- const char *filename;
-{
- if (profile_arc_flag && profile_info.count_instrumented_edges)
- {
- char name[20];
- tree string_type, string_cst;
- tree structure_decl, structure_value, structure_pointer_type;
- tree field_decl, decl_chain, value_chain;
- tree sizeof_field_value, domain_type;
-
- /* Build types. */
- string_type = build_pointer_type (char_type_node);
-
- /* Libgcc2 bb structure. */
- structure_decl = make_node (RECORD_TYPE);
- structure_pointer_type = build_pointer_type (structure_decl);
-
- /* Output the main header, of 7 words:
- 0: 1 if this file is initialized, else 0.
- 1: address of file name (LPBX1).
- 2: address of table of counts (LPBX2).
- 3: number of counts in the table.
- 4: always 0, libgcc2 uses this as a pointer to next ``struct bb''
-
- The following are GNU extensions:
-
- 5: Number of bytes in this header.
- 6: address of table of function checksums (LPBX7). */
-
- /* The zero word. */
- decl_chain =
- build_decl (FIELD_DECL, get_identifier ("zero_word"),
- long_integer_type_node);
- value_chain = build_tree_list (decl_chain,
- convert (long_integer_type_node,
- integer_zero_node));
-
- /* Address of filename. */
- {
- char *cwd, *da_filename;
- int da_filename_len;
-
- field_decl =
- build_decl (FIELD_DECL, get_identifier ("filename"), string_type);
- TREE_CHAIN (field_decl) = decl_chain;
- decl_chain = field_decl;
-
- cwd = getpwd ();
- da_filename_len = strlen (filename) + strlen (cwd) + 4 + 1;
- da_filename = (char *) alloca (da_filename_len);
- strcpy (da_filename, cwd);
- strcat (da_filename, "/");
- strcat (da_filename, filename);
- strcat (da_filename, ".da");
- da_filename_len = strlen (da_filename);
- string_cst = build_string (da_filename_len + 1, da_filename);
- domain_type = build_index_type (build_int_2 (da_filename_len, 0));
- TREE_TYPE (string_cst)
- = build_array_type (char_type_node, domain_type);
- value_chain = tree_cons (field_decl,
- build1 (ADDR_EXPR, string_type, string_cst),
- value_chain);
- }
-
- /* Table of counts. */
- {
- tree gcov_type_type = make_unsigned_type (GCOV_TYPE_SIZE);
- tree gcov_type_pointer_type = build_pointer_type (gcov_type_type);
- tree domain_tree
- = build_index_type (build_int_2 (profile_info.
- count_instrumented_edges - 1, 0));
- tree gcov_type_array_type
- = build_array_type (gcov_type_type, domain_tree);
- tree gcov_type_array_pointer_type
- = build_pointer_type (gcov_type_array_type);
- tree counts_table;
-
- field_decl =
- build_decl (FIELD_DECL, get_identifier ("counts"),
- gcov_type_pointer_type);
- TREE_CHAIN (field_decl) = decl_chain;
- decl_chain = field_decl;
-
- /* No values. */
- counts_table
- = build (VAR_DECL, gcov_type_array_type, NULL_TREE, NULL_TREE);
- TREE_STATIC (counts_table) = 1;
- ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 2);
- DECL_NAME (counts_table) = get_identifier (name);
- assemble_variable (counts_table, 0, 0, 0);
-
- value_chain = tree_cons (field_decl,
- build1 (ADDR_EXPR,
- gcov_type_array_pointer_type,
- counts_table), value_chain);
- }
-
- /* Count of the # of instrumented arcs. */
- field_decl
- = build_decl (FIELD_DECL, get_identifier ("ncounts"),
- long_integer_type_node);
- TREE_CHAIN (field_decl) = decl_chain;
- decl_chain = field_decl;
-
- value_chain = tree_cons (field_decl,
- convert (long_integer_type_node,
- build_int_2 (profile_info.
- count_instrumented_edges,
- 0)), value_chain);
- /* Pointer to the next bb. */
- field_decl
- = build_decl (FIELD_DECL, get_identifier ("next"),
- structure_pointer_type);
- TREE_CHAIN (field_decl) = decl_chain;
- decl_chain = field_decl;
-
- value_chain = tree_cons (field_decl, null_pointer_node, value_chain);
-
- /* sizeof(struct bb). We'll set this after entire structure
- is laid out. */
- field_decl
- = build_decl (FIELD_DECL, get_identifier ("sizeof_bb"),
- long_integer_type_node);
- TREE_CHAIN (field_decl) = decl_chain;
- decl_chain = field_decl;
-
- sizeof_field_value = tree_cons (field_decl, NULL, value_chain);
- value_chain = sizeof_field_value;
-
- /* struct bb_function []. */
- {
- struct function_list *item;
- int num_nodes;
- tree checksum_field, arc_count_field, name_field;
- tree domain;
- tree array_value_chain = NULL_TREE;
- tree bb_fn_struct_type;
- tree bb_fn_struct_array_type;
- tree bb_fn_struct_array_pointer_type;
- tree bb_fn_struct_pointer_type;
- tree field_value, field_value_chain;
-
- bb_fn_struct_type = make_node (RECORD_TYPE);
-
- checksum_field = build_decl (FIELD_DECL, get_identifier ("checksum"),
- long_integer_type_node);
-
- arc_count_field
- = build_decl (FIELD_DECL, get_identifier ("arc_count"),
- integer_type_node);
- TREE_CHAIN (checksum_field) = arc_count_field;
-
- name_field
- = build_decl (FIELD_DECL, get_identifier ("name"), string_type);
- TREE_CHAIN (arc_count_field) = name_field;
-
- TYPE_FIELDS (bb_fn_struct_type) = checksum_field;
-
- num_nodes = 0;
-
- for (item = functions_head; item != 0; item = item->next)
- num_nodes++;
-
- /* Note that the array contains a terminator, hence no - 1. */
- domain = build_index_type (build_int_2 (num_nodes, 0));
-
- bb_fn_struct_pointer_type = build_pointer_type (bb_fn_struct_type);
- bb_fn_struct_array_type
- = build_array_type (bb_fn_struct_type, domain);
- bb_fn_struct_array_pointer_type
- = build_pointer_type (bb_fn_struct_array_type);
-
- layout_type (bb_fn_struct_type);
- layout_type (bb_fn_struct_pointer_type);
- layout_type (bb_fn_struct_array_type);
- layout_type (bb_fn_struct_array_pointer_type);
-
- for (item = functions_head; item != 0; item = item->next)
- {
- size_t name_len;
-
- /* create constructor for structure. */
- field_value_chain
- = build_tree_list (checksum_field,
- convert (long_integer_type_node,
- build_int_2 (item->cfg_checksum, 0)));
- field_value_chain
- = tree_cons (arc_count_field,
- convert (integer_type_node,
- build_int_2 (item->count_edges, 0)),
- field_value_chain);
-
- name_len = strlen (item->name);
- string_cst = build_string (name_len + 1, item->name);
- domain_type = build_index_type (build_int_2 (name_len, 0));
- TREE_TYPE (string_cst)
- = build_array_type (char_type_node, domain_type);
- field_value_chain = tree_cons (name_field,
- build1 (ADDR_EXPR, string_type,
- string_cst),
- field_value_chain);
-
- /* Add to chain. */
- array_value_chain
- = tree_cons (NULL_TREE, build (CONSTRUCTOR,
- bb_fn_struct_type, NULL_TREE,
- nreverse (field_value_chain)),
- array_value_chain);
- }
-
- /* Add terminator. */
- field_value = build_tree_list (arc_count_field,
- convert (integer_type_node,
- build_int_2 (-1, 0)));
-
- array_value_chain = tree_cons (NULL_TREE,
- build (CONSTRUCTOR, bb_fn_struct_type,
- NULL_TREE, field_value),
- array_value_chain);
-
-
- /* Create constructor for array. */
- field_decl
- = build_decl (FIELD_DECL, get_identifier ("function_infos"),
- bb_fn_struct_pointer_type);
- value_chain = tree_cons (field_decl,
- build1 (ADDR_EXPR,
- bb_fn_struct_array_pointer_type,
- build (CONSTRUCTOR,
- bb_fn_struct_array_type,
- NULL_TREE,
- nreverse
- (array_value_chain))),
- value_chain);
- TREE_CHAIN (field_decl) = decl_chain;
- decl_chain = field_decl;
- }
-
- /* Finish structure. */
- TYPE_FIELDS (structure_decl) = nreverse (decl_chain);
- layout_type (structure_decl);
-
- structure_value
- = build (VAR_DECL, structure_decl, NULL_TREE, NULL_TREE);
- DECL_INITIAL (structure_value)
- = build (CONSTRUCTOR, structure_decl, NULL_TREE,
- nreverse (value_chain));
- TREE_STATIC (structure_value) = 1;
- ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 0);
- DECL_NAME (structure_value) = get_identifier (name);
-
- /* Size of this structure. */
- TREE_VALUE (sizeof_field_value)
- = convert (long_integer_type_node,
- build_int_2 (int_size_in_bytes (structure_decl), 0));
-
- /* Build structure. */
- assemble_variable (structure_value, 0, 0, 0);
- }
-}
-
/* Default target function prologue and epilogue assembler output.
If not overridden for epilogue code, then the function body itself
@@ -1718,7 +1438,7 @@ profile_function (file)
#ifndef NO_PROFILE_COUNTERS
data_section ();
ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT));
- ASM_OUTPUT_INTERNAL_LABEL (file, "LP", current_function_funcdef_no);
+ (*targetm.asm_out.internal_label) (file, "LP", current_function_funcdef_no);
assemble_integer (const0_rtx, LONG_TYPE_SIZE / BITS_PER_UNIT, align, 1);
#endif
@@ -1823,7 +1543,6 @@ final (first, file, optimize, prescan)
int max_uid = 0;
last_ignored_compare = 0;
- new_block = 1;
/* Make a map indicating which line numbers appear in this function.
When producing SDB debugging info, delete troublesome line number
@@ -1904,23 +1623,6 @@ final (first, file, optimize, prescan)
insn = final_scan_insn (insn, file, optimize, prescan, 0);
}
- /* Store function names for edge-profiling. */
- /* ??? Probably should re-use the existing struct function. */
-
- if (cfun->arc_profile)
- {
- struct function_list *new_item = xmalloc (sizeof (struct function_list));
-
- *functions_tail = new_item;
- functions_tail = &new_item->next;
-
- new_item->next = 0;
- new_item->name = xstrdup (IDENTIFIER_POINTER
- (DECL_ASSEMBLER_NAME (current_function_decl)));
- new_item->cfg_checksum = profile_info.current_function_cfg_checksum;
- new_item->count_edges = profile_info.count_edges_instrumented_now;
- }
-
free (line_note_exists);
line_note_exists = NULL;
}
@@ -2223,7 +1925,6 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
#endif
if (prescan > 0)
break;
- new_block = 1;
#ifdef FINAL_PRESCAN_LABEL
FINAL_PRESCAN_INSN (insn, NULL, 0);
@@ -2274,7 +1975,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
ASM_OUTPUT_CASE_LABEL (file, "L", CODE_LABEL_NUMBER (insn),
NEXT_INSN (insn));
#else
- ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (insn));
+ (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (insn));
#endif
#endif
break;
@@ -2283,7 +1984,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
if (LABEL_ALT_ENTRY_P (insn))
output_alternate_entry_point (file, insn);
else
- ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (insn));
+ (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (insn));
break;
default:
@@ -2765,7 +2466,6 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
if (prev_nonnote_insn (insn) != last_ignored_compare)
abort ();
- new_block = 0;
/* We have already processed the notes between the setter and
the user. Make sure we don't process them again, this is
@@ -2799,7 +2499,6 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
abort ();
#endif
- new_block = 0;
return new;
}
@@ -4048,7 +3747,7 @@ int
only_leaf_regs_used ()
{
int i;
- char *permitted_reg_in_leaf_functions = LEAF_REGISTERS;
+ const char *const permitted_reg_in_leaf_functions = LEAF_REGISTERS;
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if ((regs_ever_live[i] || global_regs[i])
diff --git a/gcc/fix-header.c b/gcc/fix-header.c
index bce334dee03..d722450a622 100644
--- a/gcc/fix-header.c
+++ b/gcc/fix-header.c
@@ -71,8 +71,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
Written by Per Bothner <bothner@cygnus.com>, July 1993. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "obstack.h"
#include "scan.h"
#include "cpplib.h"
diff --git a/gcc/fixinc/fixlib.h b/gcc/fixinc/fixlib.h
index 6bcc6e2c666..88f396998b3 100644
--- a/gcc/fixinc/fixlib.h
+++ b/gcc/fixinc/fixlib.h
@@ -25,10 +25,10 @@ Boston, MA 02111-1307, USA. */
#ifndef GCC_FIXLIB_H
#define GCC_FIXLIB_H
-#include "auto-host.h"
-#include "ansidecl.h"
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "gnu-regex.h"
#include "machname.h"
diff --git a/gcc/fixinc/procopen.c b/gcc/fixinc/procopen.c
index 98f1226ca5d..a8b5ca11075 100644
--- a/gcc/fixinc/procopen.c
+++ b/gcc/fixinc/procopen.c
@@ -45,12 +45,9 @@
* choice whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*/
-#include "auto-host.h"
-#include "ansidecl.h"
-#include "system.h"
-#include "server.h"
#include "fixlib.h"
+#include "server.h"
STATIC const char* def_args[] =
{ (char *) NULL, (char *) NULL };
diff --git a/gcc/fixinc/server.c b/gcc/fixinc/server.c
index e58a09fa3ab..842a32181ef 100644
--- a/gcc/fixinc/server.c
+++ b/gcc/fixinc/server.c
@@ -45,18 +45,10 @@
* choice whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*/
-#include "auto-host.h"
-
-#include "ansidecl.h"
-#include "system.h"
-#include <signal.h>
+#include "fixlib.h"
#include "server.h"
-#if !defined(volatile) && !defined(HAVE_VOLATILE)
-# define volatile
-#endif
-
STATIC volatile enum t_bool read_pipe_timeout;
STATIC pid_t server_master_pid = NOPROCESS;
diff --git a/gcc/fixinc/server.h b/gcc/fixinc/server.h
index c27a51eb493..27c53d7a0b0 100644
--- a/gcc/fixinc/server.h
+++ b/gcc/fixinc/server.h
@@ -49,13 +49,6 @@
#ifndef GCC_SERVER_H
#define GCC_SERVER_H
-#include <stdio.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include "fixlib.h"
-
/*
* Dual pipe opening of a child process
*/
diff --git a/gcc/flow.c b/gcc/flow.c
index 9ac4f2f9fd8..17cf6aa8ed4 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -120,6 +120,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "tm_p.h"
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index a7556f438e5..1454d414f09 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -44,6 +44,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "flags.h"
#include "tree.h"
#include "real.h"
@@ -5081,6 +5083,18 @@ fold (expr)
}
else if (TREE_CODE (arg0) == ABS_EXPR || TREE_CODE (arg0) == NEGATE_EXPR)
return build1 (ABS_EXPR, type, TREE_OPERAND (arg0, 0));
+ else
+ {
+ /* fabs(sqrt(x)) = sqrt(x) and fabs(exp(x)) = exp(x). */
+ enum built_in_function fcode = builtin_mathfn_code (arg0);
+ if (fcode == BUILT_IN_SQRT
+ || fcode == BUILT_IN_SQRTF
+ || fcode == BUILT_IN_SQRTL
+ || fcode == BUILT_IN_EXP
+ || fcode == BUILT_IN_EXPF
+ || fcode == BUILT_IN_EXPL)
+ t = arg0;
+ }
return t;
case CONJ_EXPR:
@@ -5521,6 +5535,38 @@ fold (expr)
tree arg = save_expr (arg0);
return build (PLUS_EXPR, type, arg, arg);
}
+
+ if (flag_unsafe_math_optimizations)
+ {
+ enum built_in_function fcode0 = builtin_mathfn_code (arg0);
+ enum built_in_function fcode1 = builtin_mathfn_code (arg1);
+
+ /* Optimize sqrt(x)*sqrt(y) as sqrt(x*y). */
+ if ((fcode0 == BUILT_IN_SQRT && fcode1 == BUILT_IN_SQRT)
+ || (fcode0 == BUILT_IN_SQRTF && fcode1 == BUILT_IN_SQRTF)
+ || (fcode0 == BUILT_IN_SQRTL && fcode1 == BUILT_IN_SQRTL))
+ {
+ tree sqrtfn = TREE_OPERAND (TREE_OPERAND (arg0, 0), 0);
+ tree arg = build (MULT_EXPR, type,
+ TREE_VALUE (TREE_OPERAND (arg0, 1)),
+ TREE_VALUE (TREE_OPERAND (arg1, 1)));
+ tree arglist = build_tree_list (NULL_TREE, arg);
+ return fold (build_function_call_expr (sqrtfn, arglist));
+ }
+
+ /* Optimize exp(x)*exp(y) as exp(x+y). */
+ if ((fcode0 == BUILT_IN_EXP && fcode1 == BUILT_IN_EXP)
+ || (fcode0 == BUILT_IN_EXPF && fcode1 == BUILT_IN_EXPF)
+ || (fcode0 == BUILT_IN_EXPL && fcode1 == BUILT_IN_EXPL))
+ {
+ tree expfn = TREE_OPERAND (TREE_OPERAND (arg0, 0), 0);
+ tree arg = build (PLUS_EXPR, type,
+ TREE_VALUE (TREE_OPERAND (arg0, 1)),
+ TREE_VALUE (TREE_OPERAND (arg1, 1)));
+ tree arglist = build_tree_list (NULL_TREE, arg);
+ return fold (build_function_call_expr (expfn, arglist));
+ }
+ }
}
goto associate;
@@ -5689,6 +5735,23 @@ fold (expr)
TREE_OPERAND (arg1, 0)),
TREE_OPERAND (arg1, 1)));
}
+
+ /* Optimize x/exp(y) into x*exp(-y). */
+ if (flag_unsafe_math_optimizations)
+ {
+ enum built_in_function fcode = builtin_mathfn_code (arg1);
+ if (fcode == BUILT_IN_EXP
+ || fcode == BUILT_IN_EXPF
+ || fcode == BUILT_IN_EXPL)
+ {
+ tree expfn = TREE_OPERAND (TREE_OPERAND (arg1, 0), 0);
+ tree arg = build1 (NEGATE_EXPR, type,
+ TREE_VALUE (TREE_OPERAND (arg1, 1)));
+ tree arglist = build_tree_list (NULL_TREE, arg);
+ arg1 = build_function_call_expr (expfn, arglist);
+ return fold (build (MULT_EXPR, type, arg0, arg1));
+ }
+ }
goto binary;
case TRUNC_DIV_EXPR:
@@ -5734,12 +5797,25 @@ fold (expr)
goto binary;
- case LSHIFT_EXPR:
- case RSHIFT_EXPR:
case LROTATE_EXPR:
case RROTATE_EXPR:
+ if (integer_all_onesp (arg0))
+ return omit_one_operand (type, arg0, arg1);
+ goto shift;
+
+ case RSHIFT_EXPR:
+ /* Optimize -1 >> x for arithmetic right shifts. */
+ if (integer_all_onesp (arg0) && ! TREE_UNSIGNED (type))
+ return omit_one_operand (type, arg0, arg1);
+ /* ... fall through ... */
+
+ case LSHIFT_EXPR:
+ shift:
if (integer_zerop (arg1))
return non_lvalue (convert (type, arg0));
+ if (integer_zerop (arg0))
+ return omit_one_operand (type, arg0, arg1);
+
/* Since negative shift count is not well-defined,
don't try to compute it in the compiler. */
if (TREE_CODE (arg1) == INTEGER_CST && tree_int_cst_sgn (arg1) < 0)
diff --git a/gcc/function.c b/gcc/function.c
index 26334f124da..62f7a70fcc1 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -40,6 +40,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
@@ -1252,46 +1254,6 @@ push_temp_slots ()
temp_slot_level++;
}
-/* Likewise, but save the new level as the place to allocate variables
- for blocks. */
-
-#if 0
-void
-push_temp_slots_for_block ()
-{
- push_temp_slots ();
-
- var_temp_slot_level = temp_slot_level;
-}
-
-/* Likewise, but save the new level as the place to allocate temporaries
- for TARGET_EXPRs. */
-
-void
-push_temp_slots_for_target ()
-{
- push_temp_slots ();
-
- target_temp_slot_level = temp_slot_level;
-}
-
-/* Set and get the value of target_temp_slot_level. The only
- permitted use of these functions is to save and restore this value. */
-
-int
-get_target_temp_slot_level ()
-{
- return target_temp_slot_level;
-}
-
-void
-set_target_temp_slot_level (level)
- int level;
-{
- target_temp_slot_level = level;
-}
-#endif
-
/* Pop a temporary nesting level. All slots in use in the current level
are freed. */
@@ -4181,12 +4143,6 @@ delete_handlers ()
}
}
-int
-max_parm_reg_num ()
-{
- return max_parm_reg;
-}
-
/* Return the first insn following those generated by `assign_parms'. */
rtx
@@ -4197,24 +4153,6 @@ get_first_nonparm_insn ()
return get_insns ();
}
-/* Return the first NOTE_INSN_BLOCK_BEG note in the function.
- Crash if there is none. */
-
-rtx
-get_first_block_beg ()
-{
- rtx searcher;
- rtx insn = get_first_nonparm_insn ();
-
- for (searcher = insn; searcher; searcher = NEXT_INSN (searcher))
- if (GET_CODE (searcher) == NOTE
- && NOTE_LINE_NUMBER (searcher) == NOTE_INSN_BLOCK_BEG)
- return searcher;
-
- abort (); /* Invalid call to this function. (See comments above.) */
- return NULL_RTX;
-}
-
/* Return 1 if EXP is an aggregate type (or a value with aggregate type).
This means a type for which function calls must pass an address to the
function or get an address back from the function.
@@ -6292,8 +6230,6 @@ prepare_function_start ()
cfun->arc_profile = profile_arc_flag || flag_test_coverage;
- cfun->arc_profile = profile_arc_flag || flag_test_coverage;
-
cfun->function_frequency = FUNCTION_FREQUENCY_NORMAL;
cfun->max_jumptable_ents = 0;
@@ -7206,10 +7142,7 @@ emit_return_into_block (bb, line_note)
basic_block bb;
rtx line_note;
{
- rtx p, end;
-
- p = NEXT_INSN (bb->end);
- end = emit_jump_insn_after (gen_return (), bb->end);
+ emit_jump_insn_after (gen_return (), bb->end);
if (line_note)
emit_line_note_after (NOTE_SOURCE_FILE (line_note),
NOTE_LINE_NUMBER (line_note), PREV_INSN (bb->end));
@@ -7865,8 +7798,6 @@ reposition_prologue_and_epilogue_notes (f)
if (last)
{
- rtx next;
-
/* Find the prologue-end note if we haven't already, and
move it to just after the last prologue insn. */
if (note == 0)
@@ -7877,8 +7808,6 @@ reposition_prologue_and_epilogue_notes (f)
break;
}
- next = NEXT_INSN (note);
-
/* Avoid placing note between CODE_LABEL and BASIC_BLOCK note. */
if (GET_CODE (last) == CODE_LABEL)
last = NEXT_INSN (last);
diff --git a/gcc/function.h b/gcc/function.h
index 89319ebf2e3..11c781750da 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -605,8 +605,6 @@ extern void free_after_compilation PARAMS ((struct function *));
extern void init_varasm_status PARAMS ((struct function *));
-extern rtx get_first_block_beg PARAMS ((void));
-
#ifdef RTX_CODE
extern void diddle_return_value PARAMS ((void (*)(rtx, void*), void*));
extern void clobber_return_register PARAMS ((void));
diff --git a/gcc/gcc.c b/gcc/gcc.c
index b05367326ff..3f37fce6d9f 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -72,6 +72,8 @@ compilation is specified by a string called a "spec". */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include <signal.h>
#if ! defined( SIGCHLD ) && defined( SIGCLD )
# define SIGCHLD SIGCLD
@@ -197,11 +199,21 @@ static int target_help_flag;
static int report_times;
+/* Nonzero means place this string before uses of /, so that include
+ and library files can be found in an alternate location. */
+
+static const char *target_system_root = TARGET_SYSTEM_ROOT;
+
/* Nonzero means write "temp" files in source directory
and use the source file's name in them, and don't delete them. */
static int save_temps_flag;
+/* Nonzero means use pipes to communicate between subprocesses.
+ Overridden by either of the above two flags. */
+
+static int use_pipes;
+
/* The compiler version. */
static const char *compiler_version;
@@ -279,6 +291,8 @@ static char *find_a_file PARAMS ((struct path_prefix *, const char *,
int, int));
static void add_prefix PARAMS ((struct path_prefix *, const char *,
const char *, int, int, int *, int));
+static void add_sysrooted_prefix PARAMS ((struct path_prefix *, const char *,
+ const char *, int, int, int *, int));
static void translate_options PARAMS ((int *, const char *const **));
static char *skip_whitespace PARAMS ((char *));
static void delete_if_ordinary PARAMS ((const char *));
@@ -287,6 +301,15 @@ static void delete_failure_queue PARAMS ((void));
static void clear_failure_queue PARAMS ((void));
static int check_live_switch PARAMS ((int, int));
static const char *handle_braces PARAMS ((const char *));
+static inline bool input_suffix_matches PARAMS ((const char *,
+ const char *));
+static inline bool switch_matches PARAMS ((const char *,
+ const char *, int));
+static inline void mark_matching_switches PARAMS ((const char *,
+ const char *, int));
+static inline void process_marked_switches PARAMS ((void));
+static const char *process_brace_body PARAMS ((const char *, const char *,
+ const char *, int, int));
static const struct spec_function *lookup_spec_function PARAMS ((const char *));
static const char *eval_spec_function PARAMS ((const char *, const char *));
static const char *handle_spec_function PARAMS ((const char *));
@@ -297,9 +320,10 @@ static int do_spec_2 PARAMS ((const char *));
static void do_self_spec PARAMS ((const char *));
static const char *find_file PARAMS ((const char *));
static int is_directory PARAMS ((const char *, const char *, int));
-static void validate_switches PARAMS ((const char *));
+static const char *validate_switches PARAMS ((const char *));
static void validate_all_switches PARAMS ((void));
-static void give_switch PARAMS ((int, int, int));
+static inline void validate_switches_from_spec PARAMS ((const char *));
+static void give_switch PARAMS ((int, int));
static int used_arg PARAMS ((const char *, int));
static int default_arg PARAMS ((const char *, int));
static void set_multilib_dir PARAMS ((void));
@@ -363,6 +387,12 @@ or with constant text in a single argument.
with a file name chosen once per compilation, without regard
to any appended suffix (which was therefore treated just like
ordinary text), making such attacks more likely to succeed.
+ %|SUFFIX
+ like %g, but if -pipe is in effect, expands simply to "-".
+ %mSUFFIX
+ like %g, but if -pipe is in effect, expands to nothing. (We have both
+ %| and %m to accommodate differences between system assemblers; see
+ the AS_NEEDS_DASH_FOR_PIPED_INPUT target macro.)
%uSUFFIX
like %g, but generates a new temporary file name even if %uSUFFIX
was already seen.
@@ -448,10 +478,15 @@ or with constant text in a single argument.
%C process CPP_SPEC as a spec.
%1 process CC1_SPEC as a spec.
%2 process CC1PLUS_SPEC as a spec.
- %| output "-" if the input for the current command is coming from a pipe.
%* substitute the variable part of a matched option. (See below.)
Note that each comma in the substituted string is replaced by
a single space.
+ %<S remove all occurrences of -S from the command line.
+ Note - this command is position dependent. % commands in the
+ spec string before this one will see -S, % commands in the
+ spec string after this one will not.
+ %<S* remove all occurrences of all switches beginning with -S from the
+ command line.
%:function(args)
Call the named function FUNCTION, passing it ARGS. ARGS is
first processed as a nested spec string, then split into an
@@ -466,33 +501,40 @@ or with constant text in a single argument.
arguments. CC considers `-o foo' as being one switch whose
name starts with `o'. %{o*} would substitute this text,
including the space; thus, two arguments would be generated.
- %{^S*} likewise, but don't put a blank between a switch and any args.
%{S*&T*} likewise, but preserve order of S and T options (the order
of S and T in the spec is not significant). Can be any number
of ampersand-separated variables; for each the wild card is
optional. Useful for CPP as %{D*&U*&A*}.
- %{S*:X} substitutes X if one or more switches whose names start with -S are
- specified to CC. Note that the tail part of the -S option
- (i.e. the part matched by the `*') will be substituted for each
- occurrence of %* within X.
- %{<S} remove all occurrences of -S from the command line.
- Note - this option is position dependent. % commands in the
- spec string before this option will see -S, % commands in the
- spec string after this option will not.
- %{S:X} substitutes X, but only if the -S switch was given to CC.
- %{!S:X} substitutes X, but only if the -S switch was NOT given to CC.
- %{|S:X} like %{S:X}, but if no S switch, substitute `-'.
- %{|!S:X} like %{!S:X}, but if there is an S switch, substitute `-'.
- %{.S:X} substitutes X, but only if processing a file with suffix S.
- %{!.S:X} substitutes X, but only if NOT processing a file with suffix S.
- %{S|P:X} substitutes X if either -S or -P was given to CC. This may be
- combined with ! and . as above binding stronger than the OR.
+
+ %{S:X} substitutes X, if the -S switch was given to CC.
+ %{!S:X} substitutes X, if the -S switch was NOT given to CC.
+ %{S*:X} substitutes X if one or more switches whose names start
+ with -S was given to CC. Normally X is substituted only
+ once, no matter how many such switches appeared. However,
+ if %* appears somewhere in X, then X will be substituted
+ once for each matching switch, with the %* replaced by the
+ part of that switch that matched the '*'.
+ %{.S:X} substitutes X, if processing a file with suffix S.
+ %{!.S:X} substitutes X, if NOT processing a file with suffix S.
+
+ %{S|T:X} substitutes X if either -S or -T was given to CC. This may be
+ combined with !, ., and * as above binding stronger than the OR.
+ If %* appears in X, all of the alternatives must be starred, and
+ only the first matching alternative is substituted.
+ %{S:X; if S was given to CC, substitutes X;
+ T:Y; else if T was given to CC, substitutes Y;
+ :D} else substitutes D. There can be as many clauses as you need.
+ This may be combined with ., !, |, and * as above.
+
%(Spec) processes a specification defined in a specs file as *Spec:
%[Spec] as above, but put __ around -D arguments
-The conditional text X in a %{S:X} or %{!S:X} construct may contain
+The conditional text X in a %{S:X} or similar construct may contain
other nested % constructs or spaces, or even newlines. They are
-processed as usual, as described above.
+processed as usual, as described above. Trailing white space in X is
+ignored. White space may also appear anywhere on the left side of the
+colon in these constructs, except between . or * and the corresponding
+word.
The -O, -f, -m, and -W switches are handled specifically in these
constructs. If another value of -O or the negated form of a -f, -m, or
@@ -727,7 +769,11 @@ static const char *asm_options =
"%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";
static const char *invoke_as =
-"%{!S:-o %{|!pipe:%g.s} |\n as %(asm_options) %{!pipe:%g.s} %A }";
+#ifdef AS_NEEDS_DASH_FOR_PIPED_INPUT
+"%{!S:-o %|.s |\n as %(asm_options) %|.s %A }";
+#else
+"%{!S:-o %|.s |\n as %(asm_options) %m.s %A }";
+#endif
/* Some compilers have limits on line lengths, and the multilib_select
and/or multilib_matches strings can be very long, so we build them at
@@ -879,10 +925,19 @@ static const struct compiler default_compilers[] =
"%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0},
{".S", "@assembler-with-cpp", 0},
{"@assembler-with-cpp",
+#ifdef AS_NEEDS_DASH_FOR_PIPED_INPUT
"%(trad_capable_cpp) -lang-asm %(cpp_options)\
%{E|M|MM:%(cpp_debug_options)}\
- %{!M:%{!MM:%{!E:%{!S:-o %{|!pipe:%g.s} |\n\
- as %(asm_debug) %(asm_options) %{!pipe:%g.s} %A }}}}", 0},
+ %{!M:%{!MM:%{!E:%{!S:-o %|.s |\n\
+ as %(asm_debug) %(asm_options) %|.s %A }}}}"
+#else
+ "%(trad_capable_cpp) -lang-asm %(cpp_options)\
+ %{E|M|MM:%(cpp_debug_options)}\
+ %{!M:%{!MM:%{!E:%{!S:-o %|.s |\n\
+ as %(asm_debug) %(asm_options) %m.s %A }}}}"
+#endif
+ , 0},
+
#include "specs.h"
/* Mark end of table */
{0, 0, 0}
@@ -1214,6 +1269,10 @@ translate_options (argcp, argvp)
nskip += 1;
else if (! strcmp (p, "Xlinker"))
nskip += 1;
+ else if (! strcmp (p, "Xpreprocessor"))
+ nskip += 1;
+ else if (! strcmp (p, "Xassembler"))
+ nskip += 1;
/* Watch out for an option at the end of the command line that
is missing arguments, and avoid skipping past the end of the
@@ -1575,6 +1634,9 @@ init_spec ()
#else
"-lgcc_s%M"
#endif
+#ifdef USE_LIBUNWIND_EXCEPTIONS
+ " -lunwind"
+#endif
,
"-lgcc",
"-lgcc_eh");
@@ -2519,6 +2581,33 @@ add_prefix (pprefix, prefix, component, priority, require_machine_suffix,
pl->next = (*prev);
(*prev) = pl;
}
+
+/* Same as add_prefix, but prepending target_system_root to prefix. */
+static void
+add_sysrooted_prefix (pprefix, prefix, component, priority,
+ require_machine_suffix, warn, os_multilib)
+ struct path_prefix *pprefix;
+ const char *prefix;
+ const char *component;
+ /* enum prefix_priority */ int priority;
+ int require_machine_suffix;
+ int *warn;
+ int os_multilib;
+{
+ if (!IS_ABSOLUTE_PATHNAME (prefix))
+ abort ();
+
+ if (target_system_root)
+ {
+ prefix = concat (target_system_root, prefix, NULL);
+ /* We have to override this because GCC's notion of sysroot
+ moves along with GCC. */
+ component = "GCC";
+ }
+
+ add_prefix (pprefix, prefix, component, priority,
+ require_machine_suffix, warn, os_multilib);
+}
/* Execute the command specified by the arguments on the current line of spec.
When using pipes, this includes several piped-together commands
@@ -2785,7 +2874,7 @@ See %s for instructions.",
0 when initialized
1 if the switch is true in a conditional spec,
-1 if false (overridden by a later switch)
- -2 if this switch should be ignored (used in %{<S})
+ -2 if this switch should be ignored (used in %<S)
The `validated' field is nonzero if any spec has looked at this switch;
if it remains zero at the end of the run, it must be meaningless. */
@@ -2919,6 +3008,8 @@ display_help ()
fputs (_(" -Wa,<options> Pass comma-separated <options> on to the assembler\n"), stdout);
fputs (_(" -Wp,<options> Pass comma-separated <options> on to the preprocessor\n"), stdout);
fputs (_(" -Wl,<options> Pass comma-separated <options> on to the linker\n"), stdout);
+ fputs (_(" -Xassembler <arg> Pass <arg> on to the assembler\n"), stdout);
+ fputs (_(" -Xpreprocessor <arg> Pass <arg> on to the preprocessor\n"), stdout);
fputs (_(" -Xlinker <arg> Pass <arg> on to the linker\n"), stdout);
fputs (_(" -save-temps Do not delete intermediate files\n"), stdout);
fputs (_(" -pipe Use pipes rather than intermediate files\n"), stdout);
@@ -3384,6 +3475,20 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
n_infiles++;
i++;
}
+ else if (strcmp (argv[i], "-Xpreprocessor") == 0)
+ {
+ if (i + 1 == argc)
+ fatal ("argument to `-Xpreprocessor' is missing");
+
+ add_preprocessor_option (argv[i+1], strlen (argv[i+1]));
+ }
+ else if (strcmp (argv[i], "-Xassembler") == 0)
+ {
+ if (i + 1 == argc)
+ fatal ("argument to `-Xassembler' is missing");
+
+ add_assembler_option (argv[i+1], strlen (argv[i+1]));
+ }
else if (strcmp (argv[i], "-l") == 0)
{
if (i + 1 == argc)
@@ -3431,6 +3536,13 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
}
else if (strcmp (argv[i], "-time") == 0)
report_times = 1;
+ else if (strcmp (argv[i], "-pipe") == 0)
+ {
+ /* -pipe has to go into the switches array as well as
+ setting a flag. */
+ use_pipes = 1;
+ n_switches++;
+ }
else if (strcmp (argv[i], "-###") == 0)
{
/* This is similar to -v except that there is no execution
@@ -3633,6 +3745,19 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
if (have_c && have_o && lang_n_infiles > 1)
fatal ("cannot specify -o with -c or -S and multiple compilations");
+ if ((save_temps_flag || report_times) && use_pipes)
+ {
+ /* -save-temps overrides -pipe, so that temp files are produced */
+ if (save_temps_flag)
+ error ("warning: -pipe ignored because -save-temps specified");
+ /* -time overrides -pipe because we can't get correct stats when
+ multiple children are running at once. */
+ else if (report_times)
+ error ("warning: -pipe ignored because -time specified");
+
+ use_pipes = 0;
+ }
+
/* Set up the search paths before we go looking for config files. */
/* These come before the md prefixes so that we will find gcc's subcommands
@@ -3693,6 +3818,15 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
concat (tooldir_prefix, "lib", dir_separator_str, NULL),
"BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
+ if (target_system_root && gcc_exec_prefix)
+ {
+ char *tmp_prefix = make_relative_prefix (argv[0],
+ standard_bindir_prefix,
+ target_system_root);
+ if (tmp_prefix && access_check (tmp_prefix, F_OK) == 0)
+ target_system_root = tmp_prefix;
+ }
+
/* More prefixes are enabled in main, after we read the specs file
and determine whether this is cross-compilation or not. */
@@ -3782,6 +3916,16 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
infiles[n_infiles].language = "*";
infiles[n_infiles++].name = argv[++i];
}
+ else if (strcmp (argv[i], "-Xassembler") == 0)
+ {
+ infiles[n_infiles].language = "*";
+ infiles[n_infiles++].name = argv[++i];
+ }
+ else if (strcmp (argv[i], "-Xpreprocessor") == 0)
+ {
+ infiles[n_infiles].language = "*";
+ infiles[n_infiles++].name = argv[++i];
+ }
else if (strcmp (argv[i], "-l") == 0)
{ /* POSIX allows separation of -l and the lib arg;
canonicalize by concatenating -l with its arg */
@@ -3799,17 +3943,6 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
;
else if (strcmp (argv[i], "-time") == 0)
;
- else if ((save_temps_flag || report_times)
- && strcmp (argv[i], "-pipe") == 0)
- {
- /* -save-temps overrides -pipe, so that temp files are produced */
- if (save_temps_flag)
- error ("warning: -pipe ignored because -save-temps specified");
- /* -time overrides -pipe because we can't get correct stats when
- multiple children are running at once. */
- else if (report_times)
- error ("warning: -pipe ignored because -time specified");
- }
else if (strcmp (argv[i], "-###") == 0)
;
else if (argv[i][0] == '-' && argv[i][1] != 0)
@@ -3876,10 +4009,11 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
switches[n_switches].live_cond = SWITCH_OK;
switches[n_switches].validated = 0;
switches[n_switches].ordering = 0;
- /* These are always valid, since gcc.c itself understands it. */
+ /* These are always valid, since gcc.c itself understands them. */
if (!strcmp (p, "save-temps")
|| !strcmp (p, "static-libgcc")
- || !strcmp (p, "shared-libgcc"))
+ || !strcmp (p, "shared-libgcc")
+ || !strcmp (p, "pipe"))
switches[n_switches].validated = 1;
else
{
@@ -3946,7 +4080,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
infiles[n_infiles].name = 0;
}
-/* Store switches not filtered out by %{<S} in spec in COLLECT_GCC_OPTIONS
+/* Store switches not filtered out by %<S in spec in COLLECT_GCC_OPTIONS
and place that in the environment. */
static void
@@ -4178,17 +4312,12 @@ do_spec_1 (spec, inswitch, soft_matched_part)
if (argbuf_index > 0 && !strcmp (argbuf[argbuf_index - 1], "|"))
{
- for (i = 0; i < n_switches; i++)
- if (!strcmp (switches[i].part1, "pipe"))
- break;
-
/* A `|' before the newline means use a pipe here,
but only if -pipe was specified.
Otherwise, execute now and don't pass the `|' as an arg. */
- if (i < n_switches)
+ if (use_pipes)
{
input_from_pipe = 1;
- switches[i].validated = 1;
break;
}
else
@@ -4418,10 +4547,10 @@ do_spec_1 (spec, inswitch, soft_matched_part)
{
struct stat st;
- /* If save_temps_flag is off, and the HOST_BIT_BUCKET is defined,
- and it is not a directory, and it is writable, use it.
- Otherwise, fall through and treat this like any other
- temporary file. */
+ /* If save_temps_flag is off, and the HOST_BIT_BUCKET is
+ defined, and it is not a directory, and it is
+ writable, use it. Otherwise, treat this like any
+ other temporary file. */
if ((!save_temps_flag)
&& (stat (HOST_BIT_BUCKET, &st) == 0) && (!S_ISDIR (st.st_mode))
@@ -4434,9 +4563,39 @@ do_spec_1 (spec, inswitch, soft_matched_part)
break;
}
}
+ goto create_temp_file;
+ case '|':
+ if (use_pipes)
+ {
+ obstack_1grow (&obstack, '-');
+ delete_this_arg = 0;
+ arg_going = 1;
+
+ /* consume suffix */
+ while (*p == '.' || ISALPHA ((unsigned char) *p))
+ p++;
+ if (p[0] == '%' && p[1] == 'O')
+ p += 2;
+
+ break;
+ }
+ goto create_temp_file;
+ case 'm':
+ if (use_pipes)
+ {
+ /* consume suffix */
+ while (*p == '.' || ISALPHA ((unsigned char) *p))
+ p++;
+ if (p[0] == '%' && p[1] == 'O')
+ p += 2;
+
+ break;
+ }
+ goto create_temp_file;
case 'g':
case 'u':
case 'U':
+ create_temp_file:
{
struct temp_name *t;
int suffix_length;
@@ -4520,7 +4679,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
for (t = temp_names; t; t = t->next)
if (t->length == suffix_length
&& strncmp (t->suffix, suffix, suffix_length) == 0
- && t->unique == (c != 'g'))
+ && t->unique == (c == 'u' || c == 'j'))
break;
/* Make a new association if needed. %u and %j
@@ -4541,7 +4700,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
}
else
t->suffix = save_string (suffix, suffix_length);
- t->unique = (c != 'g');
+ t->unique = (c == 'u' || c == 'j');
temp_filename = make_temp_file (t->suffix);
temp_filename_length = strlen (temp_filename);
t->filename = temp_filename;
@@ -4923,6 +5082,14 @@ do_spec_1 (spec, inswitch, soft_matched_part)
}
break;
+ case 'R':
+ /* We assume there is a directory
+ separator at the end of this string. */
+ if (target_system_root)
+ obstack_grow (&obstack, target_system_root,
+ strlen (target_system_root));
+ break;
+
case 'S':
value = do_spec_1 (startfile_spec, 0, NULL);
if (value != 0)
@@ -4958,6 +5125,32 @@ do_spec_1 (spec, inswitch, soft_matched_part)
}
break;
+ /* Henceforth ignore the option(s) matching the pattern
+ after the %<. */
+ case '<':
+ {
+ unsigned len = 0;
+ int have_wildcard = 0;
+ int i;
+
+ while (p[len] && p[len] != ' ' && p[len] != '\t')
+ len++;
+
+ if (p[len-1] == '*')
+ have_wildcard = 1;
+
+ for (i = 0; i < n_switches; i++)
+ if (!strncmp (switches[i].part1, p, len - have_wildcard)
+ && (have_wildcard || switches[i].part1[len] == '\0'))
+ {
+ switches[i].live_cond = SWITCH_IGNORE;
+ switches[i].validated = 1;
+ }
+
+ p += len;
+ }
+ break;
+
case '*':
if (soft_matched_part)
{
@@ -5114,11 +5307,6 @@ do_spec_1 (spec, inswitch, soft_matched_part)
}
break;
- case '|':
- if (input_from_pipe)
- do_spec_1 ("-", 0, NULL);
- break;
-
default:
error ("spec failure: unrecognized spec option '%c'", c);
break;
@@ -5309,273 +5497,303 @@ handle_spec_function (p)
return p;
}
-/* Return 0 if we call do_spec_1 and that returns -1. */
+/* Inline subroutine of handle_braces. Returns true if the current
+ input suffix matches the atom bracketed by ATOM and END_ATOM. */
+static inline bool
+input_suffix_matches (atom, end_atom)
+ const char *atom;
+ const char *end_atom;
+{
+ return (input_suffix
+ && !strncmp (input_suffix, atom, end_atom - atom)
+ && input_suffix[end_atom - atom] == '\0');
+}
-static const char *
-handle_braces (p)
- const char *p;
+/* Inline subroutine of handle_braces. Returns true if a switch
+ matching the atom bracketed by ATOM and END_ATOM appeared on the
+ command line. */
+static inline bool
+switch_matches (atom, end_atom, starred)
+ const char *atom;
+ const char *end_atom;
+ int starred;
{
- const char *filter, *body = NULL, *endbody = NULL;
- int pipe_p = 0;
- int true_once = 0; /* If, in %{a|b:d}, at least one of a,b was seen. */
- int negate;
- int suffix;
- int include_blanks = 1;
- int elide_switch = 0;
- int ordered = 0;
-
- if (*p == '^')
- {
- /* A '^' after the open-brace means to not give blanks before args. */
- include_blanks = 0;
- ++p;
- }
+ int i;
+ int len = end_atom - atom;
+ int plen = starred ? len : -1;
- if (*p == '|')
- {
- /* A `|' after the open-brace means,
- if the test fails, output a single minus sign rather than nothing.
- This is used in %{|!pipe:...}. */
- pipe_p = 1;
- ++p;
- }
+ for (i = 0; i < n_switches; i++)
+ if (!strncmp (switches[i].part1, atom, len)
+ && (starred || switches[i].part1[len] == '\0')
+ && check_live_switch (i, plen))
+ return true;
- if (*p == '<')
- {
- /* A `<' after the open-brace means that the switch should be
- removed from the command-line. */
- elide_switch = 1;
- ++p;
- }
+ return false;
+}
-next_member:
- negate = suffix = 0;
+/* Inline subroutine of handle_braces. Mark all of the switches which
+ match ATOM (extends to END_ATOM; STARRED indicates whether there
+ was a star after the atom) for later processing. */
+static inline void
+mark_matching_switches (atom, end_atom, starred)
+ const char *atom;
+ const char *end_atom;
+ int starred;
+{
+ int i;
+ int len = end_atom - atom;
+ int plen = starred ? len : -1;
+
+ for (i = 0; i < n_switches; i++)
+ if (!strncmp (switches[i].part1, atom, len)
+ && (starred || switches[i].part1[len] == '\0')
+ && check_live_switch (i, plen))
+ switches[i].ordering = 1;
+}
- if (*p == '!')
- /* A `!' after the open-brace negates the condition:
- succeed if the specified switch is not present. */
- negate = 1, ++p;
+/* Inline subroutine of handle_braces. Process all the currently
+ marked switches through give_switch, and clear the marks. */
+static inline void
+process_marked_switches ()
+{
+ int i;
- if (*p == '.')
- /* A `.' after the open-brace means test against the current suffix. */
- {
- if (pipe_p)
- abort ();
+ for (i = 0; i < n_switches; i++)
+ if (switches[i].ordering == 1)
+ {
+ switches[i].ordering = 0;
+ give_switch (i, 0);
+ }
+}
- suffix = 1;
- ++p;
- }
+/* Handle a %{ ... } construct. P points just inside the leading {.
+ Returns a pointer one past the end of the brace block, or 0
+ if we call do_spec_1 and that returns -1. */
- if (elide_switch && (negate || pipe_p || suffix))
- {
- /* It doesn't make sense to mix elision with other flags. We
- could fatal() here, but the standard seems to be to abort. */
- abort ();
- }
+static const char *
+handle_braces (p)
+ const char *p;
+{
+ const char *atom, *end_atom;
+ const char *d_atom = NULL, *d_end_atom = NULL;
- next_ampersand:
- filter = p;
- while (*p != ':' && *p != '}' && *p != '|' && *p != '&')
- p++;
+ bool a_is_suffix;
+ bool a_is_starred;
+ bool a_is_negated;
+ bool a_matched;
- if (*p == '|' && (pipe_p || ordered))
- abort ();
+ bool a_must_be_last = false;
+ bool ordered_set = false;
+ bool disjunct_set = false;
+ bool disj_matched = false;
+ bool disj_starred = true;
+ bool n_way_choice = false;
+ bool n_way_matched = false;
- if (!body)
+#define SKIP_WHITE() do { while (*p == ' ' || *p == '\t') p++; } while (0)
+
+ do
{
- if (*p != '}' && *p != '&')
- {
- int count = 1;
- const char *q = p;
+ if (a_must_be_last)
+ abort ();
- while (*q++ != ':')
- continue;
- body = q;
+ /* Scan one "atom" (S in the description above of %{}, possibly
+ with !, ., or * modifiers). */
+ a_matched = a_is_suffix = a_is_starred = a_is_negated = false;
- while (count > 0)
- {
- if (*q == '{')
- count++;
- else if (*q == '}')
- count--;
- else if (*q == 0)
- fatal ("mismatched braces in specs");
- q++;
- }
- endbody = q;
- }
- else
- body = p, endbody = p + 1;
- }
+ SKIP_WHITE();
+ if (*p == '!')
+ p++, a_is_negated = true;
- if (suffix)
- {
- int found = (input_suffix != 0
- && (long) strlen (input_suffix) == (long) (p - filter)
- && strncmp (input_suffix, filter, p - filter) == 0);
+ SKIP_WHITE();
+ if (*p == '.')
+ p++, a_is_suffix = true;
- if (body[0] == '}')
- abort ();
+ atom = p;
+ while (ISIDNUM(*p) || *p == '-' || *p == '+' || *p == '='
+ || *p == ',' || *p == '.')
+ p++;
+ end_atom = p;
- if (negate != found
- && do_spec_1 (save_string (body, endbody-body-1), 0, NULL) < 0)
- return 0;
- }
- else if (p[-1] == '*' && (p[0] == '}' || p[0] == '&'))
- {
- /* Substitute all matching switches as separate args. */
- int i;
+ if (*p == '*')
+ p++, a_is_starred = 1;
- for (i = 0; i < n_switches; i++)
- if (!strncmp (switches[i].part1, filter, p - 1 - filter)
- && check_live_switch (i, p - 1 - filter))
- {
- if (elide_switch)
- {
- switches[i].live_cond = SWITCH_IGNORE;
- switches[i].validated = 1;
- }
- else
- ordered = 1, switches[i].ordering = 1;
- }
- }
- else
- {
- /* Test for presence of the specified switch. */
- int i;
- int present = 0;
+ SKIP_WHITE();
+ if (*p == '&' || *p == '}')
+ {
+ /* Substitute the switch(es) indicated by the current atom. */
+ ordered_set = true;
+ if (disjunct_set || n_way_choice || a_is_negated || a_is_suffix
+ || atom == end_atom)
+ abort ();
- /* If name specified ends in *, as in {x*:...},
- check for %* and handle that case. */
- if (p[-1] == '*' && !negate)
+ mark_matching_switches (atom, end_atom, a_is_starred);
+
+ if (*p == '}')
+ process_marked_switches ();
+ }
+ else if (*p == '|' || *p == ':')
{
- int substitution;
- const char *r = body;
+ /* Substitute some text if the current atom appears as a switch
+ or suffix. */
+ disjunct_set = true;
+ if (ordered_set)
+ abort ();
- /* First see whether we have %*. */
- substitution = 0;
- while (r < endbody)
+ if (atom == end_atom)
{
- if (*r == '%' && r[1] == '*')
- substitution = 1;
- r++;
+ if (!n_way_choice || disj_matched || *p == '|'
+ || a_is_negated || a_is_suffix || a_is_starred)
+ abort ();
+
+ /* An empty term may appear as the last choice of an
+ N-way choice set; it means "otherwise". */
+ a_must_be_last = true;
+ disj_matched = !n_way_matched;
+ disj_starred = false;
}
- /* If we do, handle that case. */
- if (substitution)
+ else
{
- /* Substitute all matching switches as separate args.
- But do this by substituting for %*
- in the text that follows the colon. */
-
- unsigned hard_match_len = p - filter - 1;
- char *string = save_string (body, endbody - body - 1);
-
- for (i = 0; i < n_switches; i++)
- if (!strncmp (switches[i].part1, filter, hard_match_len)
- && check_live_switch (i, -1))
- {
- do_spec_1 (string, 0, &switches[i].part1[hard_match_len]);
- /* Pass any arguments this switch has. */
- give_switch (i, 1, 1);
- suffix_subst = NULL;
- }
-
- /* We didn't match. Try again. */
- if (*p++ == '|')
- goto next_member;
- return endbody;
+ if (a_is_suffix && a_is_starred)
+ abort ();
+
+ if (!a_is_starred)
+ disj_starred = false;
+
+ /* Don't bother testing this atom if we already have a
+ match. */
+ if (!disj_matched && !n_way_matched)
+ {
+ if (a_is_suffix)
+ a_matched = input_suffix_matches (atom, end_atom);
+ else
+ a_matched = switch_matches (atom, end_atom, a_is_starred);
+
+ if (a_matched != a_is_negated)
+ {
+ disj_matched = true;
+ d_atom = atom;
+ d_end_atom = end_atom;
+ }
+ }
}
- }
- /* If name specified ends in *, as in {x*:...},
- check for presence of any switch name starting with x. */
- if (p[-1] == '*')
- {
- for (i = 0; i < n_switches; i++)
+ if (*p == ':')
{
- unsigned hard_match_len = p - filter - 1;
+ /* Found the body, that is, the text to substitute if the
+ current disjunction matches. */
+ p = process_brace_body (p + 1, d_atom, d_end_atom, disj_starred,
+ disj_matched && !n_way_matched);
+ if (p == 0)
+ return 0;
- if (!strncmp (switches[i].part1, filter, hard_match_len)
- && check_live_switch (i, hard_match_len))
+ /* If we have an N-way choice, reset state for the next
+ disjunction. */
+ if (*p == ';')
{
- present = 1;
- break;
+ n_way_choice = true;
+ n_way_matched |= disj_matched;
+ disj_matched = false;
+ disj_starred = true;
+ d_atom = d_end_atom = NULL;
}
}
}
- /* Otherwise, check for presence of exact name specified. */
else
- {
- for (i = 0; i < n_switches; i++)
- {
- if (!strncmp (switches[i].part1, filter, p - filter)
- && switches[i].part1[p - filter] == 0
- && check_live_switch (i, -1))
- {
- present = 1;
- break;
- }
- }
- }
+ abort ();
+ }
+ while (*p++ != '}');
- /* If it is as desired (present for %{s...}, absent for %{!s...})
- then substitute either the switch or the specified
- conditional text. */
- if (present != negate)
- {
- if (elide_switch)
- {
- switches[i].live_cond = SWITCH_IGNORE;
- switches[i].validated = 1;
- }
- else if (ordered || *p == '&')
- ordered = 1, switches[i].ordering = 1;
- else if (*p == '}')
- give_switch (i, 0, include_blanks);
- else
- /* Even if many alternatives are matched, only output once. */
- true_once = 1;
- }
- else if (pipe_p)
+ return p;
+
+#undef SKIP_WHITE
+}
+
+/* Subroutine of handle_braces. Scan and process a brace substitution body
+ (X in the description of %{} syntax). P points one past the colon;
+ ATOM and END_ATOM bracket the first atom which was found to be true
+ (present) in the current disjunction; STARRED indicates whether all
+ the atoms in the current disjunction were starred (for syntax validation);
+ MATCHED indicates whether the disjunction matched or not, and therefore
+ whether or not the body is to be processed through do_spec_1 or just
+ skipped. Returns a pointer to the closing } or ;, or 0 if do_spec_1
+ returns -1. */
+
+static const char *
+process_brace_body (p, atom, end_atom, starred, matched)
+ const char *p;
+ const char *atom;
+ const char *end_atom;
+ int starred;
+ int matched;
+{
+ const char *body, *end_body;
+ unsigned int nesting_level;
+ bool have_subst = false;
+
+ /* Locate the closing } or ;, honoring nested braces.
+ Trim trailing whitespace. */
+ body = p;
+ nesting_level = 1;
+ for (;;)
+ {
+ if (*p == '{')
+ nesting_level++;
+ else if (*p == '}')
{
- /* Here if a %{|...} conditional fails: output a minus sign,
- which means "standard output" or "standard input". */
- do_spec_1 ("-", 0, NULL);
- return endbody;
+ if (!--nesting_level)
+ break;
}
+ else if (*p == ';' && nesting_level == 1)
+ break;
+ else if (*p == '%' && p[1] == '*' && nesting_level == 1)
+ have_subst = true;
+ else if (*p == '\0')
+ abort ();
+ p++;
}
+
+ end_body = p;
+ while (end_body[-1] == ' ' || end_body[-1] == '\t')
+ end_body--;
- /* We didn't match; try again. */
- if (*p++ == '|')
- goto next_member;
+ if (have_subst && !starred)
+ abort ();
- if (p[-1] == '&')
+ if (matched)
{
- body = 0;
- goto next_ampersand;
- }
+ /* Copy the substitution body to permanent storage and execute it.
+ If have_subst is false, this is a simple matter of running the
+ body through do_spec_1... */
+ char *string = save_string (body, end_body - body);
+ if (!have_subst)
+ {
+ if (do_spec_1 (string, 0, NULL) < 0)
+ return 0;
+ }
+ else
+ {
+ /* ... but if have_subst is true, we have to process the
+ body once for each matching switch, with %* set to the
+ variant part of the switch. */
+ unsigned int hard_match_len = end_atom - atom;
+ int i;
- if (ordered)
- {
- int i;
- /* Doing this set of switches later preserves their command-line
- ordering. This is needed for e.g. -U, -D and -A. */
- for (i = 0; i < n_switches; i++)
- if (switches[i].ordering == 1)
- {
- switches[i].ordering = 0;
- give_switch (i, 0, include_blanks);
- }
- }
- /* Process the spec just once, regardless of match count. */
- else if (true_once)
- {
- if (do_spec_1 (save_string (body, endbody - body - 1),
- 0, NULL) < 0)
- return 0;
+ for (i = 0; i < n_switches; i++)
+ if (!strncmp (switches[i].part1, atom, hard_match_len)
+ && check_live_switch (i, hard_match_len))
+ {
+ if (do_spec_1 (string, 0,
+ &switches[i].part1[hard_match_len]) < 0)
+ return 0;
+ /* Pass any arguments this switch has. */
+ give_switch (i, 1);
+ suffix_subst = NULL;
+ }
+ }
}
- return endbody;
+ return p;
}
/* Return 0 iff switch number SWITCHNUM is obsoleted by a later switch
@@ -5660,16 +5878,12 @@ check_live_switch (switchnum, prefix_length)
the vector of switches gcc received, which is `switches'.
This cannot fail since it never finishes a command line.
- If OMIT_FIRST_WORD is nonzero, then we omit .part1 of the argument.
-
- If INCLUDE_BLANKS is nonzero, then we include blanks before each argument
- of the switch. */
+ If OMIT_FIRST_WORD is nonzero, then we omit .part1 of the argument. */
static void
-give_switch (switchnum, omit_first_word, include_blanks)
+give_switch (switchnum, omit_first_word)
int switchnum;
int omit_first_word;
- int include_blanks;
{
if (switches[switchnum].live_cond == SWITCH_IGNORE)
return;
@@ -5687,8 +5901,7 @@ give_switch (switchnum, omit_first_word, include_blanks)
{
const char *arg = *p;
- if (include_blanks)
- do_spec_1 (" ", 0, NULL);
+ do_spec_1 (" ", 0, NULL);
if (suffix_subst)
{
unsigned length = strlen (arg);
@@ -5996,34 +6209,51 @@ main (argc, argv)
if (access (specs_file, R_OK) == 0)
read_specs (specs_file, TRUE);
- /* If not cross-compiling, look for startfiles in the standard places.
- Similarly, don't add the standard prefixes if startfile handling
- will be under control of startfile_prefix_spec. */
- if (*cross_compile == '0' && *startfile_prefix_spec == 0)
+ /* If not cross-compiling, look for executables in the standard
+ places. */
+ if (*cross_compile == '0')
{
if (*md_exec_prefix)
{
add_prefix (&exec_prefixes, md_exec_prefix, "GCC",
PREFIX_PRIORITY_LAST, 0, NULL, 0);
- add_prefix (&startfile_prefixes, md_exec_prefix, "GCC",
- PREFIX_PRIORITY_LAST, 0, NULL, 0);
}
+ }
+
+ /* Look for startfiles in the standard places. */
+ if (*startfile_prefix_spec != 0
+ && do_spec_2 (startfile_prefix_spec) == 0
+ && do_spec_1 (" ", 0, NULL) == 0)
+ {
+ int ndx;
+ for (ndx = 0; ndx < argbuf_index; ndx++)
+ add_sysrooted_prefix (&startfile_prefixes, argbuf[ndx], "BINUTILS",
+ PREFIX_PRIORITY_LAST, 0, NULL, 1);
+ }
+ /* We should eventually get rid of all these and stick to
+ startfile_prefix_spec exclusively. */
+ else if (*cross_compile == '0' || target_system_root)
+ {
+ if (*md_exec_prefix)
+ add_sysrooted_prefix (&startfile_prefixes, md_exec_prefix, "GCC",
+ PREFIX_PRIORITY_LAST, 0, NULL, 1);
if (*md_startfile_prefix)
- add_prefix (&startfile_prefixes, md_startfile_prefix, "GCC",
- PREFIX_PRIORITY_LAST, 0, NULL, 1);
+ add_sysrooted_prefix (&startfile_prefixes, md_startfile_prefix,
+ "GCC", PREFIX_PRIORITY_LAST, 0, NULL, 1);
if (*md_startfile_prefix_1)
- add_prefix (&startfile_prefixes, md_startfile_prefix_1, "GCC",
- PREFIX_PRIORITY_LAST, 0, NULL, 1);
+ add_sysrooted_prefix (&startfile_prefixes, md_startfile_prefix_1,
+ "GCC", PREFIX_PRIORITY_LAST, 0, NULL, 1);
/* If standard_startfile_prefix is relative, base it on
standard_exec_prefix. This lets us move the installed tree
as a unit. If GCC_EXEC_PREFIX is defined, base
standard_startfile_prefix on that as well. */
if (IS_ABSOLUTE_PATHNAME (standard_startfile_prefix))
- add_prefix (&startfile_prefixes, standard_startfile_prefix, "BINUTILS",
- PREFIX_PRIORITY_LAST, 0, NULL, 1);
+ add_sysrooted_prefix (&startfile_prefixes,
+ standard_startfile_prefix, "BINUTILS",
+ PREFIX_PRIORITY_LAST, 0, NULL, 1);
else
{
if (gcc_exec_prefix)
@@ -6038,34 +6268,15 @@ main (argc, argv)
NULL, PREFIX_PRIORITY_LAST, 0, NULL, 1);
}
- add_prefix (&startfile_prefixes, standard_startfile_prefix_1,
- "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
- add_prefix (&startfile_prefixes, standard_startfile_prefix_2,
- "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
+ add_sysrooted_prefix (&startfile_prefixes, standard_startfile_prefix_1,
+ "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
+ add_sysrooted_prefix (&startfile_prefixes, standard_startfile_prefix_2,
+ "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
#if 0 /* Can cause surprises, and one can use -B./ instead. */
add_prefix (&startfile_prefixes, "./", NULL,
PREFIX_PRIORITY_LAST, 1, NULL, 0);
#endif
}
- else
- {
- if (!IS_ABSOLUTE_PATHNAME (standard_startfile_prefix)
- && gcc_exec_prefix)
- add_prefix (&startfile_prefixes,
- concat (gcc_exec_prefix, machine_suffix,
- standard_startfile_prefix, NULL),
- "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
- }
-
- if (*startfile_prefix_spec != 0
- && do_spec_2 (startfile_prefix_spec) == 0
- && do_spec_1 (" ", 0, NULL) == 0)
- {
- int ndx;
- for (ndx = 0; ndx < argbuf_index; ndx++)
- add_prefix (&startfile_prefixes, argbuf[ndx], "BINUTILS",
- PREFIX_PRIORITY_LAST, 0, NULL, 1);
- }
/* Process any user specified specs in the order given on the command
line. */
@@ -6511,89 +6722,106 @@ notice VPARAMS ((const char *msgid, ...))
VA_CLOSE (ap);
}
+static inline void
+validate_switches_from_spec (spec)
+ const char *spec;
+{
+ const char *p = spec;
+ char c;
+ while ((c = *p++))
+ if (c == '%' && (*p == '{' || *p == '<' || (*p == 'W' && *++p == '{')))
+ /* We have a switch spec. */
+ p = validate_switches (p + 1);
+}
+
static void
validate_all_switches ()
{
struct compiler *comp;
- const char *p;
- char c;
struct spec_list *spec;
for (comp = compilers; comp->spec; comp++)
- {
- p = comp->spec;
- while ((c = *p++))
- if (c == '%' && (*p == '{' || (*p == 'W' && *++p == '{')))
- /* We have a switch spec. */
- validate_switches (p + 1);
- }
+ validate_switches_from_spec (comp->spec);
/* Look through the linked list of specs read from the specs file. */
for (spec = specs; spec; spec = spec->next)
- {
- p = *(spec->ptr_spec);
- while ((c = *p++))
- if (c == '%' && (*p == '{' || (*p == 'W' && *++p == '{')))
- /* We have a switch spec. */
- validate_switches (p + 1);
- }
+ validate_switches_from_spec (*spec->ptr_spec);
- p = link_command_spec;
- while ((c = *p++))
- if (c == '%' && (*p == '{' || (*p == 'W' && *++p == '{')))
- /* We have a switch spec. */
- validate_switches (p + 1);
+ validate_switches_from_spec (link_command_spec);
}
/* Look at the switch-name that comes after START
and mark as valid all supplied switches that match it. */
-static void
+static const char *
validate_switches (start)
const char *start;
{
const char *p = start;
- const char *filter;
+ const char *atom;
+ size_t len;
int i;
- int suffix;
-
- if (*p == '|')
- ++p;
-
+ bool suffix = false;
+ bool starred = false;
+
+#define SKIP_WHITE() do { while (*p == ' ' || *p == '\t') p++; } while (0)
+
next_member:
+ SKIP_WHITE ();
+
if (*p == '!')
- ++p;
+ p++;
- suffix = 0;
+ SKIP_WHITE ();
if (*p == '.')
- suffix = 1, ++p;
+ suffix = true, p++;
- filter = p;
- while (*p != ':' && *p != '}' && *p != '|' && *p != '&')
+ atom = p;
+ while (ISIDNUM (*p) || *p == '-' || *p == '+' || *p == '='
+ || *p == ',' || *p == '.')
p++;
+ len = p - atom;
- if (suffix)
- ;
- else if (p[-1] == '*')
+ if (*p == '*')
+ starred = true, p++;
+
+ SKIP_WHITE ();
+
+ if (!suffix)
{
/* Mark all matching switches as valid. */
for (i = 0; i < n_switches; i++)
- if (!strncmp (switches[i].part1, filter, p - filter - 1))
+ if (!strncmp (switches[i].part1, atom, len)
+ && (starred || switches[i].part1[len] == 0))
switches[i].validated = 1;
}
- else
+
+ p++;
+ if (p[-1] == '|' || p[-1] == '&')
+ goto next_member;
+
+ if (p[-1] == ':')
{
- /* Mark an exact matching switch as valid. */
- for (i = 0; i < n_switches; i++)
+ while (*p && *p != ';' && *p != '}')
{
- if (!strncmp (switches[i].part1, filter, p - filter)
- && switches[i].part1[p - filter] == 0)
- switches[i].validated = 1;
+ if (*p == '%')
+ {
+ p++;
+ if (*p == '{' || *p == '<')
+ p = validate_switches (p+1);
+ else if (p[0] == 'W' && p[1] == '{')
+ p = validate_switches (p+2);
+ }
+ p++;
}
+
+ p++;
+ if (p[-1] == ';')
+ goto next_member;
}
- if (*p++ == '|' || p[-1] == '&')
- goto next_member;
+ return p;
+#undef SKIP_WHITE
}
struct mdswitchstr
diff --git a/gcc/gccspec.c b/gcc/gccspec.c
index 6e538b1b744..c30306c54f9 100644
--- a/gcc/gccspec.c
+++ b/gcc/gccspec.c
@@ -20,6 +20,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "gcc.h"
/* Filter argc and argv before processing by the gcc driver proper. */
diff --git a/gcc/gcov-dump.c b/gcc/gcov-dump.c
new file mode 100644
index 00000000000..700f8661b19
--- /dev/null
+++ b/gcc/gcov-dump.c
@@ -0,0 +1,462 @@
+/* Dump a gcov file, for debugging use.
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ Contributed by Nathan Sidwell <nathan@codesourcery.com>
+
+Gcov is free software; you can 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.
+
+Gcov is distributed in the hope that it will be useful,
+but WITHOUT 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 Gcov; 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"
+#include "coretypes.h"
+#include "tm.h"
+#include "version.h"
+#include <getopt.h>
+typedef HOST_WIDEST_INT gcov_type;
+#include "gcov-io.h"
+
+static void dump_file PARAMS ((const char *));
+static void print_prefix PARAMS ((const char *, unsigned));
+static void print_usage PARAMS ((void));
+static void print_version PARAMS ((void));
+static int tag_function PARAMS ((const char *, FILE *, unsigned, unsigned));
+static int tag_blocks PARAMS ((const char *, FILE *, unsigned, unsigned));
+static int tag_arcs PARAMS ((const char *, FILE *, unsigned, unsigned));
+static int tag_lines PARAMS ((const char *, FILE *, unsigned, unsigned));
+static int tag_arc_counts PARAMS ((const char *, FILE *, unsigned, unsigned));
+static int tag_summary PARAMS ((const char *, FILE *, unsigned, unsigned));
+extern int main PARAMS ((int, char **));
+
+typedef struct tag_format
+{
+ unsigned tag;
+ char const *name;
+ int (*proc) (const char *, FILE *, unsigned, unsigned);
+} tag_format_t;
+
+static int flag_dump_contents = 0;
+
+static const struct option options[] =
+{
+ { "help", no_argument, NULL, 'h' },
+ { "version", no_argument, NULL, 'v' },
+ { "long", no_argument, NULL, 'l' },
+};
+
+static tag_format_t tag_table[] =
+{
+ {0, "NOP", NULL},
+ {0, "UNKNOWN", NULL},
+ {GCOV_TAG_FUNCTION, "FUNCTION", tag_function},
+ {GCOV_TAG_BLOCKS, "BLOCKS", tag_blocks},
+ {GCOV_TAG_ARCS, "ARCS", tag_arcs},
+ {GCOV_TAG_LINES, "LINES", tag_lines},
+ {GCOV_TAG_ARC_COUNTS, "ARC_COUNTS", tag_arc_counts},
+ {GCOV_TAG_OBJECT_SUMMARY, "OBJECT_SUMMARY", tag_summary},
+ {GCOV_TAG_PROGRAM_SUMMARY, "PROGRAM_SUMMARY", tag_summary},
+ {GCOV_TAG_PLACEHOLDER_SUMMARY, "PROGRAM_PLACEHOLDER", tag_summary},
+ {GCOV_TAG_INCORRECT_SUMMARY, "PROGRAM_INCORRECT", tag_summary},
+ {0, NULL, NULL}
+};
+
+int main (argc, argv)
+ int argc ATTRIBUTE_UNUSED;
+ char **argv;
+{
+ int opt;
+
+ while ((opt = getopt_long (argc, argv, "hlv", options, NULL)) != -1)
+ {
+ switch (opt)
+ {
+ case 'h':
+ print_usage ();
+ break;
+ case 'v':
+ print_version ();
+ break;
+ case 'l':
+ flag_dump_contents = 1;
+ break;
+ default:
+ fprintf (stderr, "unknown flag `%c'\n", opt);
+ }
+ }
+
+ while (argv[optind])
+ dump_file (argv[optind++]);
+ return 0;
+}
+
+static void
+print_usage ()
+{
+ printf ("Usage: gcov-dump [OPTION] ... gcovfiles\n");
+ printf ("Print coverage file contents\n");
+ printf (" -h, --help Print this help\n");
+ printf (" -v, --version Print version number\n");
+ printf (" -l, --long Dump record contents too\n");
+}
+
+static void
+print_version ()
+{
+ char v[4];
+ unsigned version = GCOV_VERSION;
+ unsigned ix;
+
+ for (ix = 4; ix--; version >>= 8)
+ v[ix] = version;
+ printf ("gcov %.4s (GCC %s)\n", v, version_string);
+ printf ("Copyright (C) 2002 Free Software Foundation, Inc.\n");
+ printf ("This is free software; see the source for copying conditions. There is NO\n\
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n");
+}
+
+static void
+print_prefix (filename, depth)
+ const char *filename;
+ unsigned depth;
+{
+ static const char prefix[] = " ";
+
+ printf ("%s:%.*s", filename, depth, prefix);
+}
+
+static void
+dump_file (filename)
+ const char *filename;
+{
+ FILE *file = fopen (filename, "rb");
+ unsigned tags[4];
+ unsigned depth = 0;
+ unsigned magic, version;
+ unsigned tag, length;
+
+ if (!file)
+ {
+ fprintf (stderr, "%s:cannot open\n", filename);
+ return;
+ }
+
+ if (gcov_read_unsigned (file, &magic)
+ || gcov_read_unsigned (file, &version))
+ {
+ read_error:;
+ printf ("%s:read error at %ld\n", filename, ftell (file));
+ fclose (file);
+ return;
+ }
+
+ /* magic */
+ {
+ const char *type = NULL;
+ char e[4], v[4], m[4];
+ unsigned expected = GCOV_VERSION;
+ unsigned ix;
+ int different = version != GCOV_VERSION;
+
+ if (magic == GCOV_DATA_MAGIC)
+ type = "data";
+ else if (magic == GCOV_GRAPH_MAGIC)
+ type = "graph";
+ else
+ {
+ printf ("%s:not a gcov file\n", filename);
+ fclose (file);
+ return;
+ }
+ for (ix = 4; ix--; expected >>= 8, version >>= 8, magic >>= 8)
+ {
+ e[ix] = expected;
+ v[ix] = version;
+ m[ix] = magic;
+ }
+
+ printf ("%s:%s:magic `%.4s':version `%.4s'\n", filename, type, m, v);
+ if (different)
+ printf ("%s:warning:current version is `%.4s'\n", filename, e);
+ }
+
+ while (!gcov_read_unsigned (file, &tag)
+ && !gcov_read_unsigned (file, &length))
+ {
+ tag_format_t const *format;
+ unsigned tag_depth;
+ long base, end;
+
+ base = gcov_save_position (file);
+
+ if (!tag)
+ tag_depth = depth;
+ else
+ {
+ unsigned mask = GCOV_TAG_MASK (tag) >> 1;
+
+ for (tag_depth = 4; mask; mask >>= 8)
+ {
+ if ((mask & 0xff) != 0xff)
+ {
+ printf ("%s:tag `%08x' is invalid\n", filename, tag);
+ break;
+ }
+ tag_depth--;
+ }
+ }
+ for (format = tag_table; format->name; format++)
+ if (format->tag == tag)
+ goto found;
+ format = &tag_table[1];
+ found:;
+ if (tag)
+ {
+ if (depth && depth < tag_depth)
+ {
+ if (!GCOV_TAG_IS_SUBTAG (tags[depth - 1], tag))
+ printf ("%s:tag `%08x' is incorrectly nested\n",
+ filename, tag);
+ }
+ depth = tag_depth;
+ tags[depth - 1] = tag;
+ }
+
+ print_prefix (filename, tag_depth);
+ printf ("%08x:%4u:%s", tag, length, format->name);
+ if (format->proc)
+ if ((*format->proc) (filename, file, tag, length))
+ goto read_error;
+ printf ("\n");
+ end = gcov_save_position (file);
+ gcov_resync (file, base, length);
+ if (format->proc && end != base + (long)length)
+ {
+ if (end > base + (long)length)
+ printf ("%s:record size mismatch %lu bytes overread\n",
+ filename, (end - base) - length);
+ else
+ printf ("%s:record size mismatch %lu bytes unread\n",
+ filename, length - (end - base));
+ }
+ }
+ if (!feof (file))
+ goto read_error;
+ fclose (file);
+}
+
+static int
+tag_function (filename, file, tag, length)
+ const char *filename ATTRIBUTE_UNUSED;
+ FILE *file ATTRIBUTE_UNUSED;
+ unsigned tag ATTRIBUTE_UNUSED;
+ unsigned length ATTRIBUTE_UNUSED;
+{
+ char *name = NULL;
+ unsigned checksum;
+
+ if (gcov_read_string (file, &name, NULL)
+ || gcov_read_unsigned (file, &checksum))
+ return 1;
+
+ printf (" `%s' checksum=0x%08x", name, checksum);
+ free (name);
+
+ return 0;
+}
+
+static int
+tag_blocks (filename, file, tag, length)
+ const char *filename ATTRIBUTE_UNUSED;
+ FILE *file ATTRIBUTE_UNUSED;
+ unsigned tag ATTRIBUTE_UNUSED;
+ unsigned length ATTRIBUTE_UNUSED;
+{
+ unsigned n_blocks = length / 4;
+
+ printf (" %u blocks", n_blocks);
+
+ if (flag_dump_contents)
+ {
+ unsigned ix;
+
+ for (ix = 0; ix != n_blocks; ix++)
+ {
+ unsigned flags;
+ if (gcov_read_unsigned (file, &flags))
+ return 1;
+ if (!(ix & 7))
+ printf ("\n%s:\t\t%u", filename, ix);
+ printf (" %04x", flags);
+ }
+
+ }
+ else
+ gcov_skip (file, n_blocks * 4);
+
+ return 0;
+}
+
+static int
+tag_arcs (filename, file, tag, length)
+ const char *filename ATTRIBUTE_UNUSED;
+ FILE *file ATTRIBUTE_UNUSED;
+ unsigned tag ATTRIBUTE_UNUSED;
+ unsigned length ATTRIBUTE_UNUSED;
+{
+ unsigned n_arcs = (length - 4) / 8;
+
+ printf (" %u arcs", n_arcs);
+ if (flag_dump_contents)
+ {
+ unsigned ix;
+ unsigned blockno;
+
+ if (gcov_read_unsigned (file, &blockno))
+ return 1;
+
+ for (ix = 0; ix != n_arcs; ix++)
+ {
+ unsigned dst, flags;
+
+ if (gcov_read_unsigned (file, &dst)
+ || gcov_read_unsigned (file, &flags))
+ return 1;
+ if (!(ix & 3))
+ printf ("\n%s:\t\t%u:", filename, blockno);
+ printf (" %u:%04x", dst, flags);
+ }
+ }
+ else
+ gcov_skip (file, 4 + n_arcs * 8);
+
+ return 0;
+}
+
+static int
+tag_lines (filename, file, tag, length)
+ const char *filename ATTRIBUTE_UNUSED;
+ FILE *file ATTRIBUTE_UNUSED;
+ unsigned tag ATTRIBUTE_UNUSED;
+ unsigned length ATTRIBUTE_UNUSED;
+{
+ if (flag_dump_contents)
+ {
+ char *source = NULL;
+ unsigned blockno;
+ char const *sep = NULL;
+
+ if (gcov_read_unsigned (file, &blockno))
+ return 1;
+
+ while (1)
+ {
+ unsigned lineno;
+
+ if (gcov_read_unsigned (file, &lineno))
+ {
+ free (source);
+ return 1;
+ }
+ if (!lineno)
+ {
+ if (gcov_read_string (file, &source, NULL))
+ return 1;
+ if (!source)
+ break;
+ sep = NULL;
+ }
+
+ if (!sep)
+ {
+ printf ("\n%s:\t\t%u:", filename, blockno);
+ sep = "";
+ }
+ if (lineno)
+ {
+ printf ("%s%u", sep, lineno);
+ sep = ", ";
+ }
+ else
+ {
+ printf ("%s`%s'", sep, source);
+ sep = ":";
+ }
+ }
+ }
+ else
+ gcov_skip (file, length);
+
+ return 0;
+}
+
+static int
+tag_arc_counts (filename, file, tag, length)
+ const char *filename ATTRIBUTE_UNUSED;
+ FILE *file ATTRIBUTE_UNUSED;
+ unsigned tag ATTRIBUTE_UNUSED;
+ unsigned length ATTRIBUTE_UNUSED;
+{
+ unsigned n_counts = length / 8;
+
+ printf (" %u counts", n_counts);
+ if (flag_dump_contents)
+ {
+ unsigned ix;
+
+ for (ix = 0; ix != n_counts; ix++)
+ {
+ gcov_type count;
+
+ if (gcov_read_counter (file, &count))
+ return 1;
+ if (!(ix & 7))
+ printf ("\n%s:\t\t%u", filename, ix);
+ printf (" ");
+ printf (HOST_WIDEST_INT_PRINT_DEC, count);
+ }
+ }
+ else
+ gcov_skip (file, n_counts * 8);
+
+ return 0;
+}
+
+static int
+tag_summary (filename, file, tag, length)
+ const char *filename ATTRIBUTE_UNUSED;
+ FILE *file ATTRIBUTE_UNUSED;
+ unsigned tag ATTRIBUTE_UNUSED;
+ unsigned length ATTRIBUTE_UNUSED;
+{
+ struct gcov_summary summary;
+
+ if (gcov_read_summary (file, &summary))
+ return 1;
+ printf (" checksum=0x%08x", summary.checksum);
+
+ printf ("\n%s:\t\truns=%u, arcs=%u", filename,
+ summary.runs, summary.arcs);
+ printf ("\n%s:\t\tarc_sum=", filename);
+ printf (HOST_WIDEST_INT_PRINT_DEC,
+ (HOST_WIDEST_INT)summary.arc_sum);
+ printf (", arc_max_one=");
+ printf (HOST_WIDEST_INT_PRINT_DEC,
+ (HOST_WIDEST_INT)summary.arc_max_one);
+ printf ("\n%s:\t\tmax_sum=", filename);
+ printf (HOST_WIDEST_INT_PRINT_DEC,
+ (HOST_WIDEST_INT)summary.arc_max_sum);
+ printf (", sum_max=");
+ printf (HOST_WIDEST_INT_PRINT_DEC,
+ (HOST_WIDEST_INT)summary.arc_sum_max);
+ return 0;
+}
diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h
index 29a44017fde..79686f5a848 100644
--- a/gcc/gcov-io.h
+++ b/gcc/gcov-io.h
@@ -1,6 +1,7 @@
-/* Machine-independent I/O routines for gcov.
- Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+/* File format for coverage information
+ Copyright (C) 1996, 1997, 1998, 2000, 2002 Free Software Foundation, Inc.
Contributed by Bob Manson <manson@cygnus.com>.
+ Completely remangled by Nathan Sidwell <nathan@codesourcery.com>.
This file is part of GCC.
@@ -19,279 +20,474 @@ 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. */
+/* Coverage information is held in two files. A basic block graph
+ file, which is generated by the compiler, and a counter file, which
+ is generated by the program under test. Both files use a similar
+ structure. We do not attempt to make these files backwards
+ compatible with previous versions, as you only need coverage
+ information when developing a program. We do hold version
+ information, so that mismatches can be detected, and we use a
+ format that allows tools to skip information they do not understand
+ or are not interested in.
+
+ Numbers are recorded in big endian unsigned binary form. Either in
+ 32 or 64 bits. Strings are stored with a length count and NUL
+ terminator, and 0 to 3 bytes of zero padding up to the next 4 byte
+ boundary. Zero length and NULL strings are simply stored as a
+ length of zero (they have no trailing NUL or padding).
+
+ int32: byte3 byte2 byte1 byte0
+ int64: byte7 byte6 byte5 byte4 byte3 byte2 byte1 byte0
+ string: int32:0 | int32:length char* char:0 padding
+ padding: | char:0 | char:0 char:0 | char:0 char:0 char:0
+ item: int32 | int64 | string
+
+ The basic format of the files is
+
+ file : int32:magic int32:version record*
+
+ The magic ident is different for the bbg and the counter files.
+ The version is the same for both files and is derived from gcc's
+ version number. Although the ident and version are formally 32 bit
+ numbers, they are derived from 4 character ASCII strings. The
+ version number consists of the single character major version
+ number, a two character minor version number (leading zero for
+ versions less than 10), and a single character indicating the
+ status of the release. That will be 'e' experimental, 'p'
+ prerelease and 'r' for release. Because, by good fortune, these are
+ in alphabetical order, string collating can be used to compare
+ version strings, and because numbers are stored big endian, numeric
+ comparison can be used when it is read as a 32 bit value. Be aware
+ that the 'e' designation will (naturally) be unstable and might be
+ incompatible with itself. For gcc 3.4 experimental, it would be
+ '304e' (0x33303465). When the major version reaches 10, the letters
+ A-Z will be used. Assuming minor increments releases every 6
+ months, we have to make a major increment every 50 years. Assuming
+ major increments releases every 5 years, we're ok for the next 155
+ years -- good enough for me.
+
+ A record has a tag, length and variable amount of data.
+
+ record: header data
+ header: int32:tag int32:length
+ data: item*
+
+ Records are not nested, but there is a record hierarchy. Tag
+ numbers reflect this hierarchy. Tags are unique across bbg and da
+ files. Some record types have a varying amount of data. The LENGTH
+ is usually used to determine how much data. The tag value is split
+ into 4 8-bit fields, one for each of four possible levels. The
+ most significant is allocated first. Unused levels are zero.
+ Active levels are odd-valued, so that the LSB of the level is one.
+ A sub-level incorporates the values of its superlevels. This
+ formatting allows you to determine the tag heirarchy, without
+ understanding the tags themselves, and is similar to the standard
+ section numbering used in technical documents. Level values
+ [1..3f] are used for common tags, values [41..9f] for the graph
+ file and [a1..ff] for the counter file.
+
+ The basic block graph file contains the following records
+ bbg: function-graph*
+ function-graph: announce_function basic_blocks {arcs | lines}*
+ announce_function: header string:name int32:checksum
+ basic_block: header int32:flags*
+ arcs: header int32:block_no arc*
+ arc: int32:dest_block int32:flags
+ lines: header int32:block_no line*
+ int32:0 string:NULL
+ line: int32:line_no | int32:0 string:filename
+
+ The BASIC_BLOCK record holds per-bb flags. The number of blocks
+ can be inferred from its data length. There is one ARCS record per
+ basic block. The number of arcs from a bb is implicit from the
+ data length. It enumerates the destination bb and per-arc flags.
+ There is one LINES record per basic block, it enumerates the source
+ lines which belong to that basic block. Source file names are
+ introduced by a line number of 0, following lines are from the new
+ source file. The initial source file for the function is NULL, but
+ the current source file should be remembered from one LINES record
+ to the next. The end of a block is indicated by an empty filename
+ - this does not reset the current source file. Note there is no
+ ordering of the ARCS and LINES records: they may be in any order,
+ interleaved in any manner. The current filename follows the order
+ the LINES records are stored in the file, *not* the ordering of the
+ blocks they are for.
+
+ The data file contains the following records.
+ da: {function-data* summary:object summary:program*}*
+ function-data: announce_function arc_counts
+ announce_function: header string:name int32:checksum
+ arc_counts: header int64:count*
+ summary: in32:checksum int32:runs int32:arcs int64:sum int64:max \
+ int64:max_sum int64:sum_max
+
+ The ANNOUNCE_FUNCTION record is the same as that in the BBG file.
+ The ARC_COUNTS gives the counter values for those arcs that are
+ instrumented. The SUMMARY records give information about the whole
+ object file and about the whole program. The checksum is used for
+ whole program summaries, and disambiguates different programs which
+ include the same instrumented object file. There may be several
+ program summaries, each with a unique checksum. The object
+ summary's checkum is zero. Note that the da file might contain
+ information from several runs concatenated, or the data might be
+ merged.
+
+ This file is included by both the compiler, gcov tools and the
+ library. The IN_LIBGCC2 define distinguishes these cases. When
+ IN_LIBGCC2 is nonzero, we're building libgcc2 for the target and
+ know the compiler is (the just built) gcc. Otherwise we're
+ generating code for the host, and the compiler may or may not be
+ gcc. In this latter case, you must ensure that 'gcov_type' is
+ typedefed to something suitable (unsigned HOST_WIDEST_INT is
+ usually what you want). */
+
#ifndef GCC_GCOV_IO_H
#define GCC_GCOV_IO_H
-#include <stdio.h>
-#include <sys/types.h>
-
-static int __fetch_long PARAMS ((long *, char *, size_t))
- ATTRIBUTE_UNUSED;
-static int __read_long PARAMS ((long *, FILE *, size_t))
- ATTRIBUTE_UNUSED;
-static int __write_long PARAMS ((long, FILE *, size_t))
- ATTRIBUTE_UNUSED;
-static int __fetch_gcov_type PARAMS ((gcov_type *, char *, size_t))
- ATTRIBUTE_UNUSED;
-static int __store_gcov_type PARAMS ((gcov_type, char *, size_t))
- ATTRIBUTE_UNUSED;
-static int __read_gcov_type PARAMS ((gcov_type *, FILE *, size_t))
- ATTRIBUTE_UNUSED;
-static int __write_gcov_type PARAMS ((gcov_type, FILE *, size_t))
- ATTRIBUTE_UNUSED;
-static int __write_gcov_string PARAMS ((const char *, size_t, FILE*, long))
- ATTRIBUTE_UNUSED;
-static int __read_gcov_string PARAMS ((char *, size_t, FILE*, long))
- ATTRIBUTE_UNUSED;
-
-/* These routines only work for signed values. */
-
-/* Store a portable representation of VALUE in DEST using BYTES*8-1 bits.
- Return a nonzero value if VALUE requires more than BYTES*8-1 bits
- to store. */
-static int
-__store_gcov_type (value, dest, bytes)
- gcov_type value;
- char *dest;
- size_t bytes;
+#if IN_LIBGCC2
+#if LONG_TYPE_SIZE == GCOV_TYPE_SIZE
+typedef long gcov_type;
+#else
+typedef long long gcov_type;
+#endif
+#endif /* IN_LIBGCC2 */
+
+/* File suffixes. */
+#define GCOV_DATA_SUFFIX ".da"
+#define GCOV_GRAPH_SUFFIX ".bbg"
+
+/* File magic. */
+#define GCOV_DATA_MAGIC 0x67636f76 /* "gcov" */
+#define GCOV_GRAPH_MAGIC 0x67626267 /* "gbbg" */
+
+/* gcov-iov.h is automatically generated by the makefile from
+ version.c, it looks like
+ #define GCOV_VERSION ((unsigned)0x89abcdef)
+*/
+#include "gcov-iov.h"
+
+/* The record tags. Values [1..3f] are for tags which may be in either
+ file. Values [41..9f] for those in the bbg file and [a1..ff] for
+ the data file. */
+
+#define GCOV_TAG_FUNCTION ((unsigned)0x01000000)
+#define GCOV_TAG_BLOCKS ((unsigned)0x01410000)
+#define GCOV_TAG_ARCS ((unsigned)0x01430000)
+#define GCOV_TAG_LINES ((unsigned)0x01450000)
+#define GCOV_TAG_ARC_COUNTS ((unsigned)0x01a10000)
+#define GCOV_TAG_OBJECT_SUMMARY ((unsigned)0xa1000000)
+#define GCOV_TAG_PROGRAM_SUMMARY ((unsigned)0xa3000000)
+#define GCOV_TAG_PLACEHOLDER_SUMMARY ((unsigned)0xa5000000)
+#define GCOV_TAG_INCORRECT_SUMMARY ((unsigned)0xa7000000)
+
+/* The tag level mask has 1's in the position of the inner levels, &
+ the lsb of the current level, and zero on the current and outer
+ levels. */
+#define GCOV_TAG_MASK(TAG) (((TAG) - 1) ^ (TAG))
+
+/* Return nonzero if SUB is an immediate subtag of TAG. */
+#define GCOV_TAG_IS_SUBTAG(TAG,SUB) \
+ (GCOV_TAG_MASK (TAG) >> 8 == GCOV_TAG_MASK (SUB) \
+ && !(((SUB) ^ (TAG)) & ~GCOV_TAG_MASK(TAG)))
+
+/* Return nonzero if SUB is at a sublevel to TAG. */
+#define GCOV_TAG_IS_SUBLEVEL(TAG,SUB) \
+ (GCOV_TAG_MASK (TAG) > GCOV_TAG_MASK (SUB))
+
+/* Basic block flags. */
+#define GCOV_BLOCK_UNEXPECTED (1 << 0)
+
+/* Arc flags. */
+#define GCOV_ARC_ON_TREE (1 << 0)
+#define GCOV_ARC_FAKE (1 << 1)
+#define GCOV_ARC_FALLTHROUGH (1 << 2)
+
+/* Structured records. */
+
+/* Object & program summary record. */
+struct gcov_summary
{
- int upper_bit = (value < 0 ? 128 : 0);
- size_t i;
-
- if (value < 0)
- {
- gcov_type oldvalue = value;
- value = -value;
- if (oldvalue != -value)
- return 1;
- }
-
- for(i = 0 ; i < (sizeof (value) < bytes ? sizeof (value) : bytes) ; i++) {
- dest[i] = value & (i == (bytes - 1) ? 127 : 255);
- value = value / 256;
- }
-
- if (value && value != -1)
- return 1;
-
- for(; i < bytes ; i++)
- dest[i] = 0;
- dest[bytes - 1] |= upper_bit;
- return 0;
-}
-
-/* Retrieve a quantity containing BYTES*8-1 bits from SOURCE and store
- the result in DEST. Returns a nonzero value if the value in SOURCE
- will not fit in DEST. */
-
-static int
-__fetch_gcov_type (dest, source, bytes)
- gcov_type *dest;
- char *source;
- size_t bytes;
+ unsigned checksum; /* checksum of program */
+ unsigned runs; /* number of program runs */
+ unsigned arcs; /* number of instrumented arcs */
+ gcov_type arc_sum; /* sum of all arc counters */
+ gcov_type arc_max_one; /* max counter on any one run */
+ gcov_type arc_max_sum; /* maximum arc_sum */
+ gcov_type arc_sum_max; /* sum of max_one */
+};
+
+#if IN_LIBGCC2
+/* Structures embedded in coveraged program. The structures generated
+ by write_profile must match these. */
+
+/* Information about a single function. */
+struct function_info
{
- gcov_type value = 0;
- int i;
-
- for (i = bytes - 1; (size_t) i > (sizeof (*dest) - 1); i--)
- if (source[i] & ((size_t) i == (bytes - 1) ? 127 : 255 ))
- return 1;
-
- for (; i >= 0; i--)
- value = value * 256 + (source[i] & ((size_t)i == (bytes - 1) ? 127 : 255));
-
- if ((source[bytes - 1] & 128) && (value > 0))
- value = - value;
-
- *dest = value;
- return 0;
-}
+ const char *name; /* (mangled) name of function */
+ unsigned checksum; /* function checksum */
+ unsigned n_arc_counts; /* number of instrumented arcs */
+};
-static int
-__fetch_long (dest, source, bytes)
- long *dest;
- char *source;
- size_t bytes;
+/* Information about a single object file. */
+struct gcov_info
{
- long value = 0;
- int i;
-
- for (i = bytes - 1; (size_t) i > (sizeof (*dest) - 1); i--)
- if (source[i] & ((size_t) i == (bytes - 1) ? 127 : 255 ))
- return 1;
-
- for (; i >= 0; i--)
- value = value * 256 + (source[i] & ((size_t)i == (bytes - 1) ? 127 : 255));
-
- if ((source[bytes - 1] & 128) && (value > 0))
- value = - value;
-
- *dest = value;
- return 0;
-}
-
-/* Write a BYTES*8-bit quantity to FILE, portably. Returns a nonzero
- value if the write fails, or if VALUE can't be stored in BYTES*8
- bits.
-
- Note that VALUE may not actually be large enough to hold BYTES*8
- bits, but BYTES characters will be written anyway.
-
- BYTES may be a maximum of 10. */
+ unsigned long version; /* expected version number */
+ struct gcov_info *next; /* link to next, used by libgcc */
+
+ const char *filename; /* output file name */
+ long wkspc; /* libgcc workspace */
+
+ const struct function_info *functions; /* table of functions */
+ unsigned n_functions; /* number of functions */
+
+ gcov_type *arc_counts; /* table of arc counts */
+ unsigned n_arc_counts; /* number of arc counts */
+};
+
+/* Register a new object file module. */
+extern void __gcov_init (struct gcov_info *);
+
+/* Called before fork, to avoid double counting. */
+extern void __gcov_flush (void);
+
+#endif /* IN_LIBGCC2 */
+
+/* Functions for reading and writing gcov files. */
+static int gcov_write_unsigned PARAMS((FILE *, unsigned))
+ ATTRIBUTE_UNUSED;
+static int gcov_write_counter PARAMS((FILE *, gcov_type))
+ ATTRIBUTE_UNUSED;
+static int gcov_write_string PARAMS((FILE *, const char *, unsigned))
+ ATTRIBUTE_UNUSED;
+static int gcov_read_unsigned PARAMS((FILE *, unsigned *))
+ ATTRIBUTE_UNUSED;
+static int gcov_read_counter PARAMS((FILE *, gcov_type *))
+ ATTRIBUTE_UNUSED;
+#if !IN_LIBGCC2
+static int gcov_read_string PARAMS((FILE *, char **, unsigned *))
+ ATTRIBUTE_UNUSED;
+#endif
+static int gcov_read_summary PARAMS ((FILE *, struct gcov_summary *))
+ ATTRIBUTE_UNUSED;
+#if IN_LIBGCC2
+static int gcov_write_summary PARAMS ((FILE *, unsigned,
+ const struct gcov_summary *))
+ ATTRIBUTE_UNUSED;
+#endif
+#define gcov_save_position(STREAM) \
+ ftell (STREAM)
+#define gcov_reserve_length(STREAM) \
+ (gcov_write_unsigned (STREAM, 0) ? 0 : ftell (STREAM) - 4)
+static int gcov_write_length PARAMS((FILE *, long))
+ ATTRIBUTE_UNUSED;
+#define gcov_resync(STREAM, BASE, LENGTH) \
+ fseek (STREAM, BASE + (long)LENGTH, SEEK_SET)
+#define gcov_skip(STREAM, LENGTH) \
+ fseek (STREAM, LENGTH, SEEK_CUR)
+#define gcov_skip_string(STREAM, LENGTH) \
+ fseek (STREAM, (LENGTH) + 4 - ((LENGTH) & 3), SEEK_CUR)
+
+
+/* Write VALUE to coverage file FILE. Return nonzero if failed due to
+ file i/o error, or value error. */
static int
-__write_gcov_type (value, file, bytes)
- gcov_type value;
+gcov_write_unsigned (file, value)
FILE *file;
- size_t bytes;
+ unsigned value;
{
- char c[10];
+ char buffer[4];
+ unsigned ix;
- if (bytes > 10 || __store_gcov_type (value, c, bytes))
- return 1;
- else
- return fwrite(c, 1, bytes, file) != bytes;
+ for (ix = sizeof (buffer); ix--; )
+ {
+ buffer[ix] = value;
+ value >>= 8;
+ }
+ return ((sizeof (value) > sizeof (buffer) && value)
+ || fwrite (buffer, sizeof (buffer), 1, file) != 1);
}
+/* Write VALUE to coverage file FILE. Return nonzero if failed due to
+ file i/o error, or value error. Negative values are not checked
+ here -- they are checked in gcov_read_counter. */
+
static int
-__write_long (value, file, bytes)
- long value;
+gcov_write_counter (file, value)
FILE *file;
- size_t bytes;
+ gcov_type value;
{
- char c[10];
+ char buffer[8];
+ unsigned ix;
- if (bytes > 10 || __store_gcov_type ((gcov_type)value, c, bytes))
- return 1;
- else
- return fwrite(c, 1, bytes, file) != bytes;
+ for (ix = sizeof (buffer); ix--; )
+ {
+ buffer[ix] = value;
+ value >>= 8;
+ }
+ return ((sizeof (value) > sizeof (buffer) && value != 0 && value != -1)
+ || fwrite (buffer, sizeof (buffer), 1, file) != 1);
}
-/* Read a quantity containing BYTES bytes from FILE, portably. Return
- a nonzero value if the read fails or if the value will not fit
- in DEST.
-
- Note that DEST may not be large enough to hold all of the requested
- data, but the function will read BYTES characters anyway.
-
- BYTES may be a maximum of 10. */
+/* Write VALUE to coverage file FILE. Return nonzero if failed due to
+ file i/o error, or value error. */
static int
-__read_gcov_type (dest, file, bytes)
- gcov_type *dest;
+gcov_write_string (file, string, length)
FILE *file;
- size_t bytes;
+ unsigned length;
+ const char *string;
{
- char c[10];
+ unsigned pad = 0;
- if (bytes > 10 || fread(c, 1, bytes, file) != bytes)
- return 1;
+ if (string)
+ return (gcov_write_unsigned (file, length)
+ || fwrite (string, length, 1, file) != 1
+ || fwrite (&pad, 4 - (length & 3), 1, file) != 1);
else
- return __fetch_gcov_type (dest, c, bytes);
+ return gcov_write_unsigned (file, 0);
}
+/* Read *VALUE_P from coverage file FILE. Return nonzero if failed
+ due to file i/o error, or range error. */
+
static int
-__read_long (dest, file, bytes)
- long *dest;
+gcov_read_unsigned (file, value_p)
FILE *file;
- size_t bytes;
+ unsigned *value_p;
{
- char c[10];
+ unsigned value = 0;
+ unsigned ix;
+ unsigned char buffer[4];
- if (bytes > 10 || fread(c, 1, bytes, file) != bytes)
+ if (fread (buffer, sizeof (buffer), 1, file) != 1)
return 1;
- else
- return __fetch_long (dest, c, bytes);
+ for (ix = sizeof (value); ix < sizeof (buffer); ix++)
+ if (buffer[ix])
+ return 1;
+ for (ix = 0; ix != sizeof (buffer); ix++)
+ {
+ value <<= 8;
+ value |= buffer[ix];
+ }
+ *value_p = value;
+ return 0;
}
-
-/* Writes string in gcov format. */
+/* Read *VALUE_P from coverage file FILE. Return nonzero if failed
+ due to file i/o error, or range error. */
static int
-__write_gcov_string (string, length, file, delim)
- const char *string;
- size_t length;
+gcov_read_counter (file, value_p)
FILE *file;
- long delim;
+ gcov_type *value_p;
{
- size_t temp = length + 1;
-
- /* delimiter */
- if (__write_long (delim, file, 4) != 0)
- return 1;
-
- if (__write_long (length, file, 4) != 0)
- return 1;
+ gcov_type value = 0;
+ unsigned ix;
+ unsigned char buffer[8];
- if (fwrite (string, temp, 1, file) != 1)
+ if (fread (buffer, sizeof (buffer), 1, file) != 1)
return 1;
-
- temp &= 3;
-
- if (temp)
+ for (ix = sizeof (value); ix < sizeof (buffer); ix++)
+ if (buffer[ix])
+ return 1;
+ for (ix = 0; ix != sizeof (buffer); ix++)
{
- char c[4];
-
- c[0] = c[1] = c[2] = c[3] = 0;
-
- if (fwrite (c, sizeof (char), 4 - temp, file) != 4 - temp)
- return 1;
+ value <<= 8;
+ value |= buffer[ix];
}
- if (__write_long (delim, file, 4) != 0)
- return 1;
-
- return 0;
+ *value_p = value;
+ return value < 0;
}
-/* Reads string in gcov format. */
+#if !IN_LIBGCC2
+/* Read string from coverage file FILE. Length is stored in *LENGTH_P
+ (if non-null), a buffer is allocated and returned in *STRING_P.
+ Return nonzero if failed due to file i/o error, or range
+ error. Uses xmalloc to allocate the string buffer. */
static int
-__read_gcov_string (string, max_length, file, delim)
- char *string;
- size_t max_length;
+gcov_read_string (file, string_p, length_p)
FILE *file;
- long delim;
+ char **string_p;
+ unsigned *length_p;
{
- long delim_from_file;
- long length;
- long read_length;
- long tmp;
+ unsigned length;
- if (__read_long (&delim_from_file, file, 4) != 0)
+ if (gcov_read_unsigned (file, &length))
return 1;
- if (delim_from_file != delim)
- return 1;
+ if (length_p)
+ *length_p = length;
+ free (*string_p);
- if (__read_long (&length, file, 4) != 0)
- return 1;
+ *string_p = NULL;
+ if (!length)
+ return 0;
- if (length > (long) max_length)
- read_length = max_length;
- else
- read_length = length;
+ length += 4 - (length & 3);
+ *string_p = (char *) xmalloc (length);
- tmp = (((length + 1) - 1) / 4 + 1) * 4;
- /* This is the size occupied by the string in the file */
+ return fread (*string_p, length, 1, file) != 1;
- if (fread (string, read_length, 1, file) != 1)
- return 1;
+}
- string[read_length] = 0;
+#endif /* !IN_LIBGCC2 */
- if (fseek (file, tmp - read_length, SEEK_CUR) < 0)
- return 1;
-
- if (__read_long (&delim_from_file, file, 4) != 0)
- return 1;
+/* Write a record length at PLACE. The current file position is the
+ end of the record, and is restored before returning. Returns
+ nonzero on failure. */
- if (delim_from_file != delim)
- return 1;
+static int
+gcov_write_length (file, place)
+ FILE *file;
+ long place;
+{
+ long here = ftell (file);
+ int result = (!place || fseek (file, place, SEEK_SET)
+ || gcov_write_unsigned (file, here - place - 4));
+ if (fseek (file, here, SEEK_SET))
+ result = 1;
+ return result;
+}
- return 0;
+#define GCOV_SUMMARY_LENGTH 44
+static int
+gcov_read_summary (da_file, summary)
+ FILE *da_file;
+ struct gcov_summary *summary;
+{
+ return (gcov_read_unsigned (da_file, &summary->checksum)
+ || gcov_read_unsigned (da_file, &summary->runs)
+ || gcov_read_unsigned (da_file, &summary->arcs)
+ || gcov_read_counter (da_file, &summary->arc_sum)
+ || gcov_read_counter (da_file, &summary->arc_max_one)
+ || gcov_read_counter (da_file, &summary->arc_max_sum)
+ || gcov_read_counter (da_file, &summary->arc_sum_max));
}
+#if IN_LIBGCC2
+static int
+gcov_write_summary (da_file, tag, summary)
+ FILE *da_file;
+ unsigned tag;
+ const struct gcov_summary *summary;
+{
+ long base;
+
+ return (gcov_write_unsigned (da_file, tag)
+ || !(base = gcov_reserve_length (da_file))
+ || gcov_write_unsigned (da_file, summary->checksum)
+ || gcov_write_unsigned (da_file, summary->runs)
+ || gcov_write_unsigned (da_file, summary->arcs)
+ || gcov_write_counter (da_file, summary->arc_sum)
+ || gcov_write_counter (da_file, summary->arc_max_one)
+ || gcov_write_counter (da_file, summary->arc_max_sum)
+ || gcov_write_counter (da_file, summary->arc_sum_max)
+ || gcov_write_length (da_file, base));
+}
+#endif
-#endif /* ! GCC_GCOV_IO_H */
+#endif /* GCC_GCOV_IO_H */
diff --git a/gcc/gcov-iov.c b/gcc/gcov-iov.c
new file mode 100644
index 00000000000..fd103c4ddd4
--- /dev/null
+++ b/gcc/gcov-iov.c
@@ -0,0 +1,70 @@
+/* Generate gcov version string from version.c. See gcov-io.h for
+ description of how the version string is generated.
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ Contributed by Nathan Sidwell <nathan@codesourcery.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 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. */
+
+#include "bconfig.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "version.c" /* We want the actual string. */
+
+int main PARAMS ((int, char **));
+
+int
+main (argc, argv)
+ int argc ATTRIBUTE_UNUSED;
+ char **argv;
+{
+ unsigned version = 0;
+ unsigned char v[4];
+ unsigned ix;
+ char const *ptr = version_string;
+ unsigned major, minor = 0;
+ char s = 0;
+
+ major = atoi (ptr);
+ while (*ptr && *ptr != '.')
+ ptr++;
+ if (*ptr)
+ minor = atoi (ptr + 1);
+ while (*ptr)
+ if (*ptr++ == '(')
+ {
+ s = *ptr;
+ break;
+ }
+
+ v[0] = (major < 10 ? '0' : 'A' - 10) + major;
+ v[1] = (minor / 10) + '0';
+ v[2] = (minor % 10) + '0';
+ v[3] = s ? s : '*';
+
+ for (ix = 0; ix != 4; ix++)
+ version = (version << 8) | v[ix];
+
+ printf ("/* Generated automatically by the program `%s'\n", argv[0]);
+ printf (" from `%s'. */\n", version_string);
+ printf ("\n");
+ printf ("#define GCOV_VERSION ((unsigned)%#08x) /* %.4s */\n",
+ version, v);
+
+ return 0;
+}
diff --git a/gcc/gcov.c b/gcc/gcov.c
index 94f9baad40b..b90d9576887 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -4,6 +4,7 @@
1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by James E. Wilson of Cygnus Support.
Mangled by Bob Manson of Cygnus Support.
+ Mangled further by Nathan Sidwell <nathan@codesourcery.com>
Gcov is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,14 +21,6 @@ along with Gcov; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* ??? The code in final.c that produces the struct bb assumes that there is
- no padding between the fields. This is not necessary true. The current
- code can only be trusted if longs and pointers are the same size. */
-
-/* ??? No need to print an execution count on every line, could just print
- it on the first line of each block, and only print it on a subsequent
- line in the same block if the count changes. */
-
/* ??? Print a list of the ten blocks with the highest execution counts,
and list the line numbers corresponding to those blocks. Also, perhaps
list the line numbers with the highest execution counts, only printing
@@ -36,15 +29,22 @@ Boston, MA 02111-1307, USA. */
/* ??? Should have an option to print the number of basic blocks, and the
percent of them that are covered. */
-/* ??? Does not correctly handle the case where two .bb files refer to the
- same included source file. For example, if one has a short file containing
- only inline functions, which is then included in two other files, then
- there will be two .bb files which refer to the include file, but there
- is no way to get the total execution counts for the included file, can
- only get execution counts for one or the other of the including files. */
+/* ??? Does not correctly handle the case where two .bb files refer to
+ the same included source file. For example, if one has a short
+ file containing only inline functions, which is then included in
+ two other files, then there will be two .bb files which refer to
+ the include file, but there is no way to get the total execution
+ counts for the included file, can only get execution counts for one
+ or the other of the including files. this can be fixed by --ratios
+ --long-file-names --preserve-paths and perl. */
+
+/* Need an option to show individual block counts, and show
+ probabilities of fall through arcs. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "intl.h"
#include "version.h"
#undef abort
@@ -54,120 +54,102 @@ Boston, MA 02111-1307, USA. */
typedef HOST_WIDEST_INT gcov_type;
#include "gcov-io.h"
-/* The .bb file format consists of several lists of 4-byte integers
- which are the line numbers of each basic block in the file. Each
- list is terminated by a zero. These lists correspond to the basic
- blocks in the reconstructed program flow graph.
-
- A line number of -1 indicates that a source file name (padded to a
- long boundary) follows. The padded file name is followed by
- another -1 to make it easy to scan past file names. A -2 indicates
- that a function name (padded to a long boundary) follows; the name
- is followed by another -2 to make it easy to scan past the function
- name.
-
- The .bbg file contains enough info to enable gcov to reconstruct the
- program flow graph. The first word is the number of basic blocks,
- the second word is the number of arcs, followed by the list of arcs
- (source bb, dest bb pairs), then a -1, then the number of instrumented
- arcs followed by the instrumented arcs, followed by another -1. This
- is repeated for each function.
-
- The .da file contains the execution count for each instrumented branch.
-
- The .bb and .bbg files are created by giving GCC the -ftest-coverage option,
- and the .da files are created when an executable compiled with
- -fprofile-arcs is run. */
+/* The bbg file is generated by -ftest-coverage option. The da file is
+ generated by a program compiled with -fprofile-arcs. Their formats
+ are documented in gcov-io.h. */
/* The functions in this file for creating and solution program flow graphs
- are very similar to functions in the gcc source file profile.c. */
+ are very similar to functions in the gcc source file profile.c. In
+ some places we make use of the knowledge of how profile.c works to
+ select particular algorithms here. */
/* This is the size of the buffer used to read in source file lines. */
#define STRING_SIZE 200
-/* One copy of this structure is created for each source file mentioned in the
- .bb file. */
+struct function_info;
+struct block_info;
-struct sourcefile
-{
- char *name;
- int maxlineno;
- struct sourcefile *next;
-};
+/* Describes an arc between two basic blocks. */
-/* This points to the head of the sourcefile structure list. */
-
-struct sourcefile *sources;
+typedef struct arc_info
+{
+ /* source and destination blocks. */
+ struct block_info *src;
+ struct block_info *dst;
-/* One of these is dynamically created whenever we identify an arc in the
- function. */
+ /* transition counts. */
+ gcov_type count;
-struct adj_list
-{
- int source;
- int target;
- gcov_type arc_count;
unsigned int count_valid : 1;
unsigned int on_tree : 1;
unsigned int fake : 1;
unsigned int fall_through : 1;
-#if 0
- /* Not needed for gcov, but defined in profile.c. */
- rtx branch_insn;
-#endif
- struct adj_list *pred_next;
- struct adj_list *succ_next;
-};
-/* Count the number of basic blocks, and create an array of these structures,
- one for each bb in the function. */
-
-struct bb_info
-{
- struct adj_list *succ;
- struct adj_list *pred;
- gcov_type succ_count;
- gcov_type pred_count;
- gcov_type exec_count;
- unsigned int count_valid : 1;
- unsigned int on_tree : 1;
-#if 0
- /* Not needed for gcov, but defined in profile.c. */
- rtx first_insn;
-#endif
-};
+ /* Arc to a call. */
+ unsigned int is_call : 1;
+
+ /* Next branch on line. */
+ struct arc_info *line_next;
+
+ /* Links to next arc on src and dst lists. */
+ struct arc_info *succ_next;
+ struct arc_info *pred_next;
+} arc_t;
-/* When outputting branch probabilities, one of these structures is created
- for each branch/call. */
+/* Describes a basic block. Contains lists of arcs to successor and
+ predecessor blocks. */
-struct arcdata
+typedef struct block_info
{
- gcov_type hits;
- gcov_type total;
- int call_insn;
- struct arcdata *next;
-};
+ /* Chain of exit and entry arcs. */
+ arc_t *succ;
+ arc_t *pred;
+
+ /* Number of unprocessed exit and entry arcs. */
+ gcov_type num_succ;
+ gcov_type num_pred;
+
+ /* Block execution count. */
+ gcov_type count;
+ unsigned count_valid : 1;
+ unsigned valid_chain : 1;
+ unsigned invalid_chain : 1;
+
+ /* Array of line numbers and source files. source files are
+ introduced by a linenumber of zero, the next 'line number' is the
+ number of the source file. Always starts with a source file. */
+ unsigned *encoding;
+ unsigned num_encodings;
+
+ /* Temporary chain for solving graph. */
+ struct block_info *chain;
+
+} block_t;
-/* Used to save the list of bb_graphs, one per function. */
+/* Describes a single function. Contains an array of basic blocks. */
-struct bb_info_list
+typedef struct function_info
{
- /* Indexed by block number, holds the basic block graph for one function. */
- struct bb_info *bb_graph;
- int num_blocks;
- struct bb_info_list *next;
-};
+ /* Name of function. */
+ char *name;
+ unsigned checksum;
-/* Used to hold information about each line. */
-struct line_info
-{
- gcov_type count; /* execution count */
- struct arcdata *branches; /* list of branch probabilities for line. */
- unsigned exists : 1; /* has code associated with it. */
-};
+ /* Array of basic blocks. */
+ block_t *blocks;
+ unsigned num_blocks;
+
+ /* Raw arc coverage counts. */
+ gcov_type *counts;
+ unsigned num_counts;
-struct coverage
+ /* Next function. */
+ struct function_info *next;
+} function_t;
+
+/* Describes coverage of a file or function. */
+
+typedef struct coverage_info
{
int lines;
int lines_executed;
@@ -180,104 +162,111 @@ struct coverage
int calls_executed;
char *name;
-};
+} coverage_t;
-/* Holds a list of function basic block graphs. */
+/* Describes a single line of source. Contains a chain of basic blocks
+ with code on it. */
-static struct bb_info_list *bb_graph_list = 0;
+typedef struct line_info
+{
+ gcov_type count; /* execution count */
+ arc_t *branches; /* branches from blocks that end on this
+ line. */
+ unsigned exists : 1;
+} line_t;
-/* Modification time of data files. */
+/* Describes a file mentioned in the block graph. Contains an array
+ of line info. */
-static time_t bb_file_time;
+typedef struct source_info
+{
+ /* Name of source file. */
+ char *name;
+ unsigned index;
-/* Name and file pointer of the input file for the basic block graph. */
+ /* Array of line information. */
+ line_t *lines;
+ unsigned num_lines;
-static char *bbg_file_name;
-static FILE *bbg_file;
+ coverage_t coverage;
+
+ /* Next source file. */
+ struct source_info *next;
+} source_t;
-/* Name and file pointer of the input file for the arc count data. */
+/* Holds a list of function basic block graphs. */
-static char *da_file_name;
-static FILE *da_file;
+static function_t *functions;
-/* Name and file pointer of the input file for the basic block line counts. */
+/* This points to the head of the sourcefile structure list. */
-static char *bb_file_name;
-static FILE *bb_file;
+static source_t *sources;
-/* Holds the entire contents of the bb_file read into memory. */
+/* Modification time of graph file. */
-static char *bb_data;
+static time_t bbg_file_time;
-/* Size of bb_data array in longs. */
+/* Name and file pointer of the input file for the basic block graph. */
-static long bb_data_size;
+static char *bbg_file_name;
-/* Name of the file mentioned on the command line. */
+/* Name and file pointer of the input file for the arc count data. */
-static char *input_file_name = 0;
+static char *da_file_name;
-/* Output branch probabilities if true. */
+/* Output branch probabilities. */
-static int output_branch_probs = 0;
+static int flag_branches = 0;
/* Output a gcov file if this is true. This is on by default, and can
be turned off by the -n option. */
-static int output_gcov_file = 1;
+static int flag_gcov_file = 1;
-/* For included files, make the gcov output file name include the name of
- the input source file. For example, if x.h is included in a.c, then the
- output file name is a.c.x.h.gcov instead of x.h.gcov. This works only
- when a single source file is specified. */
+/* For included files, make the gcov output file name include the name
+ of the input source file. For example, if x.h is included in a.c,
+ then the output file name is a.c##x.h.gcov instead of x.h.gcov. */
-static int output_long_names = 0;
+static int flag_long_names = 0;
/* Output summary info for each function. */
-static int output_function_summary = 0;
+static int flag_function_summary = 0;
-/* Object directory file prefix. This is the directory/file
- where .bb and .bbg files are looked for, if nonzero. */
+/* Object directory file prefix. This is the directory/file where the
+ graph and data files are looked for, if nonzero. */
static char *object_directory = 0;
/* Preserve all pathname components. Needed when object files and
- source files are in subdirectories. */
-static int preserve_paths = 0;
+ source files are in subdirectories. '/' is mangled as '#', '.' is
+ elided and '..' mangled to '^'. */
+
+static int flag_preserve_paths = 0;
/* Output the number of times a branch was taken as opposed to the percentage
- of times it was taken. Turned on by the -c option */
+ of times it was taken. */
-static int output_branch_counts = 0;
+static int flag_counts = 0;
/* Forward declarations. */
-static void process_args PARAMS ((int, char **));
-static void open_files PARAMS ((void));
-static void read_files PARAMS ((void));
-static void scan_for_source_files PARAMS ((void));
-static void output_data PARAMS ((struct sourcefile *));
+static void fnotice PARAMS ((FILE *, const char *, ...)) ATTRIBUTE_PRINTF_2;
+static int process_args PARAMS ((int, char **));
static void print_usage PARAMS ((int)) ATTRIBUTE_NORETURN;
static void print_version PARAMS ((void)) ATTRIBUTE_NORETURN;
-static void init_arc PARAMS ((struct adj_list *, int, int, struct bb_info *));
-static struct adj_list *reverse_arcs PARAMS ((struct adj_list *));
-static gcov_type *read_profile PARAMS ((char *, long, int));
-static void create_program_flow_graph PARAMS ((struct bb_info_list *));
-static void solve_program_flow_graph PARAMS ((struct bb_info_list *));
-static void accumulate_branch_counts PARAMS ((struct coverage *,
- struct arcdata *));
-static void calculate_branch_probs PARAMS ((struct bb_info *,
- struct line_info *,
- struct coverage *));
-static void function_summary PARAMS ((struct coverage *, const char *));
-static void init_line_info PARAMS ((struct line_info *,
- struct coverage *, long));
-static void output_line_info PARAMS ((FILE *, const struct line_info *,
- const struct coverage *, long));
-static char *make_gcov_file_name PARAMS ((char *));
-static const char *format_hwint PARAMS ((HOST_WIDEST_INT, HOST_WIDEST_INT,
- int));
-
+static void process_file PARAMS ((const char *));
+static void create_file_names PARAMS ((const char *));
+static int read_graph_file PARAMS ((void));
+static int read_count_file PARAMS ((void));
+static void solve_flow_graph PARAMS ((function_t *));
+static void add_branch_counts PARAMS ((coverage_t *, const arc_t *));
+static void add_line_counts PARAMS ((coverage_t *, const function_t *));
+static void function_summary PARAMS ((const coverage_t *, const char *));
+static const char *format_gcov PARAMS ((gcov_type, gcov_type, int));
+static void accumulate_line_counts PARAMS ((source_t *));
+static void output_lines PARAMS ((FILE *, const source_t *));
+static char *make_gcov_file_name PARAMS ((const char *, const char *));
+static void release_structures PARAMS ((void));
extern int main PARAMS ((int, char **));
int
@@ -285,25 +274,24 @@ main (argc, argv)
int argc;
char **argv;
{
- struct sourcefile *s_ptr;
+ int argno;
gcc_init_libintl ();
- process_args (argc, argv);
-
- open_files ();
-
- read_files ();
-
- scan_for_source_files ();
-
- for (s_ptr = sources; s_ptr; s_ptr = s_ptr->next)
- output_data (s_ptr);
+ argno = process_args (argc, argv);
+ if (optind == argc)
+ print_usage (true);
+ for (; argno != argc; argno++)
+ {
+ release_structures ();
+
+ process_file (argv[argno]);
+ }
+
return 0;
}
-static void fnotice PARAMS ((FILE *, const char *, ...)) ATTRIBUTE_PRINTF_2;
static void
fnotice VPARAMS ((FILE *file, const char *msgid, ...))
{
@@ -335,6 +323,7 @@ print_usage (error_p)
{
FILE *file = error_p ? stderr : stdout;
int status = error_p ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE;
+
fnotice (file, "Usage: gcov [OPTION]... SOURCEFILE\n\n");
fnotice (file, "Print code coverage information.\n\n");
fnotice (file, " -h, --help Print this help, then exit\n");
@@ -358,8 +347,14 @@ print_usage (error_p)
static void
print_version ()
{
- fnotice (stdout, "gcov (GCC) %s\n", version_string);
- fnotice (stdout, "Copyright (C) 2001 Free Software Foundation, Inc.\n");
+ char v[4];
+ unsigned version = GCOV_VERSION;
+ unsigned ix;
+
+ for (ix = 4; ix--; version >>= 8)
+ v[ix] = version;
+ fnotice (stdout, "gcov %.4s (GCC %s)\n", v, version_string);
+ fnotice (stdout, "Copyright (C) 2002 Free Software Foundation, Inc.\n");
fnotice (stdout,
"This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n");
@@ -380,9 +375,9 @@ static const struct option options[] =
{ "object-file", required_argument, NULL, 'o' },
};
-/* Parse the command line. */
+/* Process args, return index to first non-arg. */
-static void
+static int
process_args (argc, argv)
int argc;
char **argv;
@@ -400,25 +395,25 @@ process_args (argc, argv)
print_version ();
/* print_version will exit. */
case 'b':
- output_branch_probs = 1;
+ flag_branches = 1;
break;
case 'c':
- output_branch_counts = 1;
+ flag_counts = 1;
break;
case 'n':
- output_gcov_file = 0;
+ flag_gcov_file = 0;
break;
case 'l':
- output_long_names = 1;
+ flag_long_names = 1;
break;
case 'f':
- output_function_summary = 1;
+ flag_function_summary = 1;
break;
case 'o':
object_directory = optarg;
break;
case 'p':
- preserve_paths = 1;
+ flag_preserve_paths = 1;
break;
default:
print_usage (true);
@@ -426,27 +421,135 @@ process_args (argc, argv)
}
}
- if (optind != argc - 1)
- print_usage (true);
+ return optind;
+}
+
+/* Process a single source file. */
- input_file_name = argv[optind];
+static void
+process_file (file_name)
+ const char *file_name;
+{
+ source_t *src;
+ function_t *fn;
+
+ create_file_names (file_name);
+ if (read_graph_file ())
+ return;
+
+ if (!functions)
+ {
+ fnotice (stderr, "%s:no functions found\n", bbg_file_name);
+ return;
+ }
+
+ if (read_count_file ())
+ return;
+
+ for (fn = functions; fn; fn = fn->next)
+ solve_flow_graph (fn);
+ for (src = sources; src; src = src->next)
+ src->lines = (line_t *) xcalloc (src->num_lines, sizeof (line_t));
+ for (fn = functions; fn; fn = fn->next)
+ {
+ coverage_t coverage;
+
+ memset (&coverage, 0, sizeof (coverage));
+ coverage.name = fn->name;
+ add_line_counts (flag_function_summary ? &coverage : NULL, fn);
+ if (flag_function_summary)
+ {
+ function_summary (&coverage, "Function");
+ fnotice (stdout, "\n");
+ }
+ }
+
+ for (src = sources; src; src = src->next)
+ {
+ accumulate_line_counts (src);
+ function_summary (&src->coverage, "File");
+ if (flag_gcov_file)
+ {
+ char *gcov_file_name = make_gcov_file_name (file_name, src->name);
+ FILE *gcov_file = fopen (gcov_file_name, "w");
+
+ if (gcov_file)
+ {
+ fnotice (stdout, "%s:creating `%s'\n",
+ src->name, gcov_file_name);
+ output_lines (gcov_file, src);
+ if (ferror (gcov_file))
+ fnotice (stderr, "%s:error writing output file `%s'\n",
+ src->name, gcov_file_name);
+ fclose (gcov_file);
+ }
+ else
+ fnotice (stderr, "%s:could not open output file `%s'\n",
+ src->name, gcov_file_name);
+ free (gcov_file_name);
+ }
+ fnotice (stdout, "\n");
+ }
}
+/* Release all memory used. */
-/* Find and open the .bb, .da, and .bbg files. If OBJECT_DIRECTORY is
- not specified, these are looked for in the current directory, and
- named from the basename of the input_file_name sans extension. If
+static void
+release_structures ()
+{
+ function_t *fn;
+ source_t *src;
+
+ free (bbg_file_name);
+ free (da_file_name);
+ da_file_name = bbg_file_name = NULL;
+ bbg_file_time = 0;
+
+ while ((src = sources))
+ {
+ sources = src->next;
+
+ free (src->name);
+ free (src->lines);
+ }
+
+ while ((fn = functions))
+ {
+ unsigned ix;
+ block_t *block;
+
+ functions = fn->next;
+ for (ix = fn->num_blocks, block = fn->blocks; ix--; block++)
+ {
+ arc_t *arc, *arc_n;
+
+ for (arc = block->succ; arc; arc = arc_n)
+ {
+ arc_n = arc->succ_next;
+ free (arc);
+ }
+ free (block->encoding);
+ }
+ free (fn->blocks);
+ free (fn->counts);
+ }
+}
+
+/* Generate the names of the graph and data files. If OBJECT_DIRECTORY
+ is not specified, these are looked for in the current directory,
+ and named from the basename of the FILE_NAME sans extension. If
OBJECT_DIRECTORY is specified and is a directory, the files are in
- that directory, but named from the basename of the input_file_name,
- sans extension. Otherwise OBJECT_DIRECTORY is taken to be the name
- of the object *file*, and the data files are named from that. */
+ that directory, but named from the basename of the FILE_NAME, sans
+ extension. Otherwise OBJECT_DIRECTORY is taken to be the name of
+ the object *file*, and the data files are named from that. */
static void
-open_files ()
+create_file_names (file_name)
+ const char *file_name;
{
char *cptr;
char *name;
- int length = strlen (input_file_name);
+ int length = strlen (file_name);
int base;
if (object_directory && object_directory[0])
@@ -472,658 +575,640 @@ open_files ()
if (base)
{
/* Append source file name */
- cptr = strrchr (input_file_name, '/');
- cptr = cptr ? cptr + 1 : input_file_name;
-
- strcat (name, cptr);
+ cptr = strrchr (file_name, '/');
+ strcat (name, cptr ? cptr + 1 : file_name);
}
+
/* Remove the extension. */
cptr = strrchr (name, '.');
if (cptr)
*cptr = 0;
length = strlen (name);
- da_file_name = xmalloc (length + 4);
- bb_file_name = xmalloc (length + 4);
- bbg_file_name = xmalloc (length + 5);
-
- strcpy (da_file_name, name);
- strcpy (bb_file_name, name);
- strcpy (bbg_file_name, name);
- strcpy (da_file_name + length, ".da");
- strcpy (bb_file_name + length, ".bb");
- strcpy (bbg_file_name + length, ".bbg");
-
- bb_file = fopen (bb_file_name, "rb");
- if (bb_file == NULL)
- {
- fnotice (stderr, "Could not open basic block file %s.\n", bb_file_name);
- exit (FATAL_EXIT_CODE);
- }
-
- bbg_file = fopen (bbg_file_name, "rb");
- if (bbg_file == NULL)
- {
- fnotice (stderr, "Could not open program flow graph file %s.\n",
- bbg_file_name);
- exit (FATAL_EXIT_CODE);
- }
- {
- struct stat status;
+ bbg_file_name = xmalloc (length + strlen (GCOV_GRAPH_SUFFIX) + 1);
+ strcpy (bbg_file_name, name);
+ strcpy (bbg_file_name + length, GCOV_GRAPH_SUFFIX);
- if (!fstat (fileno (bb_file), &status))
- bb_file_time = status.st_mtime;
- }
+ da_file_name = xmalloc (length + strlen (GCOV_DATA_SUFFIX) + 1);
+ strcpy (da_file_name, name);
+ strcpy (da_file_name + length, GCOV_DATA_SUFFIX);
- /* If none of the functions in the file were executed, then there won't
- be a .da file. Just assume that all counts are zero in this case. */
- da_file = fopen (da_file_name, "rb");
- if (da_file == NULL)
- {
- fnotice (stderr, "Could not open data file %s.\n", da_file_name);
- fnotice (stderr, "Assuming that all execution counts are zero.\n");
- }
-
- /* Check for empty .bbg file. This indicates that there is no executable
- code in this source file. */
- /* Set the EOF condition if at the end of file. */
- ungetc (getc (bbg_file), bbg_file);
- if (feof (bbg_file))
- {
- fnotice (stderr, "No executable code associated with file %s.\n",
- input_file_name);
- exit (FATAL_EXIT_CODE);
- }
+ return;
}
-
-/* Initialize a new arc. */
-static void
-init_arc (arcptr, source, target, bb_graph)
- struct adj_list *arcptr;
- int source, target;
- struct bb_info *bb_graph;
-{
- arcptr->target = target;
- arcptr->source = source;
-
- arcptr->arc_count = 0;
- arcptr->count_valid = 0;
- arcptr->on_tree = 0;
- arcptr->fake = 0;
- arcptr->fall_through = 0;
-
- arcptr->succ_next = bb_graph[source].succ;
- bb_graph[source].succ = arcptr;
- bb_graph[source].succ_count++;
-
- arcptr->pred_next = bb_graph[target].pred;
- bb_graph[target].pred = arcptr;
- bb_graph[target].pred_count++;
-}
+/* Read the graph file. Return non-zero on fatal error. */
-/* Reverse the arcs on an arc list. */
-
-static struct adj_list *
-reverse_arcs (arcptr)
- struct adj_list *arcptr;
+static int
+read_graph_file ()
{
- struct adj_list *prev = 0;
- struct adj_list *next;
-
- for ( ; arcptr; arcptr = next)
+ FILE *file;
+ struct stat status;
+ unsigned magic, version;
+ unsigned current_tag = 0;
+ unsigned tag;
+ struct function_info *fn = NULL;
+ source_t *src = NULL;
+ unsigned ix;
+
+ file = fopen (bbg_file_name, "rb");
+ if (!file)
{
- next = arcptr->succ_next;
- arcptr->succ_next = prev;
- prev = arcptr;
+ fnotice (stderr, "%s:cannot open graph file\n", bbg_file_name);
+ return 1;
}
-
- return prev;
-}
-
-/* Reads profiles from the .da file and compute a hybrid profile. */
-
-static gcov_type *
-read_profile (function_name, cfg_checksum, instr_arcs)
- char *function_name;
- long cfg_checksum;
- int instr_arcs;
-{
- int i;
- int okay = 1;
- gcov_type *profile;
- char *function_name_buffer;
- int function_name_buffer_len;
-
- profile = xmalloc (sizeof (gcov_type) * instr_arcs);
- function_name_buffer_len = strlen (function_name) + 1;
- function_name_buffer = xmalloc (function_name_buffer_len + 1);
-
- for (i = 0; i < instr_arcs; i++)
- profile[i] = 0;
-
- if (!da_file)
- return profile;
-
- rewind (da_file);
- while (1)
+ if (!fstat (fileno (file), &status))
+ bbg_file_time = status.st_mtime;
+ if (gcov_read_unsigned (file, &magic) || magic != GCOV_GRAPH_MAGIC)
{
- long magic, extra_bytes;
- long func_count;
- int i;
+ fnotice (stderr, "%s:not a gcov graph file\n", bbg_file_name);
+ fclose (file);
+ return 1;
+ }
- if (__read_long (&magic, da_file, 4) != 0)
- break;
+ if (gcov_read_unsigned (file, &version) || version != GCOV_VERSION)
+ {
+ char v[4], e[4];
- if (magic != -123)
+ magic = GCOV_VERSION;
+
+ for (ix = 4; ix--; magic >>= 8, version >>= 8)
{
- okay = 0;
- break;
+ v[ix] = version;
+ e[ix] = magic;
}
+ fnotice (stderr, "%s:version `%.4s', prefer `%.4s'\n",
+ bbg_file_name, v, e);
+ }
+
+ while (!gcov_read_unsigned (file, &tag))
+ {
+ unsigned length;
+ long base;
- if (__read_long (&func_count, da_file, 4) != 0)
- {
- okay = 0;
- break;
- }
+ if (gcov_read_unsigned (file, &length))
+ goto corrupt;
- if (__read_long (&extra_bytes, da_file, 4) != 0)
+ base = gcov_save_position (file);
+
+ if (tag == GCOV_TAG_FUNCTION)
{
- okay = 0;
- break;
+ char *function_name = NULL;
+ unsigned checksum;
+
+ if (gcov_read_string (file, &function_name, NULL)
+ || gcov_read_unsigned (file, &checksum))
+ goto corrupt;
+ fn = (function_t *)xcalloc (1, sizeof (function_t));
+ fn->name = function_name;
+ fn->checksum = checksum;
+
+ fn->next = functions;
+ functions = fn;
+ current_tag = tag;
}
-
- /* skip extra data emited by __bb_exit_func. */
- fseek (da_file, extra_bytes, SEEK_CUR);
-
- for (i = 0; i < func_count; i++)
+ else if (fn && tag == GCOV_TAG_BLOCKS)
{
- long arc_count;
- long chksum;
- int j;
-
- if (__read_gcov_string
- (function_name_buffer, function_name_buffer_len, da_file,
- -1) != 0)
- {
- okay = 0;
- break;
- }
-
- if (__read_long (&chksum, da_file, 4) != 0)
+ if (fn->blocks)
+ fnotice (stderr, "%s:already seen blocks for `%s'\n",
+ bbg_file_name, fn->name);
+ else
{
- okay = 0;
- break;
+ fn->num_blocks = length / 4;
+ fn->blocks
+ = (block_t *)xcalloc (fn->num_blocks, sizeof (block_t));
}
-
- if (__read_long (&arc_count, da_file, 4) != 0)
+ }
+ else if (fn && tag == GCOV_TAG_ARCS)
+ {
+ unsigned src;
+ unsigned num_dests = (length - 4) / 8;
+ unsigned dest, flags;
+
+ if (gcov_read_unsigned (file, &src)
+ || src >= fn->num_blocks
+ || fn->blocks[src].succ)
+ goto corrupt;
+
+ while (num_dests--)
{
- okay = 0;
- break;
+ struct arc_info *arc;
+
+ if (gcov_read_unsigned (file, &dest)
+ || gcov_read_unsigned (file, &flags)
+ || dest >= fn->num_blocks)
+ goto corrupt;
+ arc = (arc_t *) xcalloc (1, sizeof (arc_t));
+
+ arc->dst = &fn->blocks[dest];
+ arc->src = &fn->blocks[src];
+
+ arc->count = 0;
+ arc->count_valid = 0;
+ arc->on_tree = !!(flags & GCOV_ARC_ON_TREE);
+ arc->fake = !!(flags & GCOV_ARC_FAKE);
+ arc->fall_through = !!(flags & GCOV_ARC_FALLTHROUGH);
+
+ arc->succ_next = fn->blocks[src].succ;
+ fn->blocks[src].succ = arc;
+ fn->blocks[src].num_succ++;
+
+ arc->pred_next = fn->blocks[dest].pred;
+ fn->blocks[dest].pred = arc;
+ fn->blocks[dest].num_pred++;
+
+ arc->is_call = arc->fake;
+
+ if (!arc->on_tree)
+ fn->num_counts++;
}
-
- if (strcmp (function_name_buffer, function_name) != 0
- || arc_count != instr_arcs || chksum != cfg_checksum)
+ }
+ else if (fn && tag == GCOV_TAG_LINES)
+ {
+ unsigned blockno;
+ unsigned *line_nos
+ = (unsigned *)xcalloc ((length - 4) / 4, sizeof (unsigned));
+
+ if (gcov_read_unsigned (file, &blockno)
+ || blockno >= fn->num_blocks
+ || fn->blocks[blockno].encoding)
+ goto corrupt;
+
+ for (ix = 0; ; )
{
- /* skip */
- if (fseek (da_file, arc_count * 8, SEEK_CUR) < 0)
+ unsigned lineno;
+
+ if (gcov_read_unsigned (file, &lineno))
+ goto corrupt;
+ if (lineno)
{
- okay = 0;
- break;
+ if (!ix)
+ {
+ line_nos[ix++] = 0;
+ line_nos[ix++] = src->index;
+ }
+ line_nos[ix++] = lineno;
+ if (lineno >= src->num_lines)
+ src->num_lines = lineno + 1;
}
- }
- else
- {
- gcov_type tmp;
-
- for (j = 0; j < arc_count; j++)
- if (__read_gcov_type (&tmp, da_file, 8) != 0)
- {
- okay = 0;
+ else
+ {
+ char *file_name = NULL;
+
+ if (gcov_read_string (file, &file_name, NULL))
+ goto corrupt;
+ if (!file_name)
break;
- }
- else
- {
- profile[j] += tmp;
- }
+ for (src = sources; src; src = src->next)
+ if (!strcmp (file_name, src->name))
+ {
+ free (file_name);
+ break;
+ }
+ if (!src)
+ {
+ src = (source_t *)xcalloc (1, sizeof (source_t));
+ src->name = file_name;
+ src->coverage.name = file_name;
+ src->index = sources ? sources->index + 1 : 1;
+ src->next = sources;
+ sources = src;
+ }
+ line_nos[ix++] = 0;
+ line_nos[ix++] = src->index;
+ }
}
+
+ fn->blocks[blockno].encoding = line_nos;
+ fn->blocks[blockno].num_encodings = ix;
+ }
+ else if (current_tag && !GCOV_TAG_IS_SUBTAG (current_tag, tag))
+ {
+ fn = NULL;
+ current_tag = 0;
+ }
+ if (gcov_resync (file, base, length))
+ {
+ corrupt:;
+ fnotice (stderr, "%s:corrupted\n", bbg_file_name);
+ fclose (file);
+ return 1;
}
-
- if (!okay)
- break;
-
}
+ fclose (file);
+
+ /* We built everything backwards, so nreverse them all */
+
+ /* Reverse sources. Not strictly necessary, but we'll then process
+ them in the 'expected' order. */
+ {
+ source_t *src, *src_p, *src_n;
+
+ for (src_p = NULL, src = sources; src; src_p = src, src = src_n)
+ {
+ src_n = src->next;
+ src->next = src_p;
+ }
+ sources = src_p;
+ }
- free (function_name_buffer);
+ /* Reverse functions. */
+ {
+ function_t *fn, *fn_p, *fn_n;
- if (!okay)
- {
- fprintf (stderr, ".da file corrupted!\n");
- free (profile);
- abort ();
- }
+ for (fn_p = NULL, fn = functions; fn; fn_p = fn, fn = fn_n)
+ {
+ unsigned ix;
+
+ fn_n = fn->next;
+ fn->next = fn_p;
- return profile;
+ /* Reverse the arcs */
+ for (ix = fn->num_blocks; ix--;)
+ {
+ arc_t *arc, *arc_p, *arc_n;
+
+ for (arc_p = NULL, arc = fn->blocks[ix].succ; arc;
+ arc_p = arc, arc = arc_n)
+ {
+ arc_n = arc->succ_next;
+ arc->succ_next = arc_p;
+ }
+ fn->blocks[ix].succ = arc_p;
+
+ for (arc_p = NULL, arc = fn->blocks[ix].pred; arc;
+ arc_p = arc, arc = arc_n)
+ {
+ arc_n = arc->pred_next;
+ arc->pred_next = arc_p;
+ }
+ fn->blocks[ix].pred = arc_p;
+ }
+ }
+ functions = fn_p;
+ }
+ return 0;
}
-/* Construct the program flow graph from the .bbg file, and read in the data
- in the .da file. */
+/* Reads profiles from the count file and attach to each
+ function. Return non-zero if fatal error. */
-static void
-create_program_flow_graph (bptr)
- struct bb_info_list *bptr;
+static int
+read_count_file ()
{
- long num_blocks, number_arcs, src, dest, flag_bits, num_arcs_per_block;
- int i;
- struct adj_list *arcptr;
- struct bb_info *bb_graph;
- long cfg_checksum;
- long instr_arcs = 0;
- gcov_type *profile;
- int profile_pos = 0;
- char *function_name;
- long function_name_len, tmp;
-
- /* Read function name. */
- __read_long (&tmp, bbg_file, 4); /* ignore -1. */
- __read_long (&function_name_len, bbg_file, 4);
- function_name = xmalloc (function_name_len + 1);
- fread (function_name, 1, function_name_len + 1, bbg_file);
-
- /* Skip padding. */
- tmp = (function_name_len + 1) % 4;
-
- if (tmp)
- fseek (bbg_file, 4 - tmp, SEEK_CUR);
-
- __read_long (&tmp, bbg_file, 4); /* ignore -1. */
-
- /* Read the cfg checksum. */
- __read_long (&cfg_checksum, bbg_file, 4);
-
- /* Read the number of blocks. */
- __read_long (&num_blocks, bbg_file, 4);
-
- /* Create an array of size bb number of bb_info structs. */
- bb_graph = (struct bb_info *) xcalloc (num_blocks, sizeof (struct bb_info));
-
- bptr->bb_graph = bb_graph;
- bptr->num_blocks = num_blocks;
-
- /* Read and create each arc from the .bbg file. */
- __read_long (&number_arcs, bbg_file, 4);
- for (i = 0; i < num_blocks; i++)
+ FILE *file;
+ unsigned ix;
+ char *function_name_buffer = NULL;
+ unsigned magic, version;
+ function_t *fn = NULL;
+
+ file = fopen (da_file_name, "rb");
+ if (!file)
{
- int j;
-
- __read_long (&num_arcs_per_block, bbg_file, 4);
- for (j = 0; j < num_arcs_per_block; j++)
+ fnotice (stderr, "%s:cannot open data file\n", da_file_name);
+ return 1;
+ }
+ if (gcov_read_unsigned (file, &magic) || magic != GCOV_DATA_MAGIC)
+ {
+ fnotice (stderr, "%s:not a gcov data file\n", da_file_name);
+ cleanup:;
+ free (function_name_buffer);
+ fclose (file);
+ return 1;
+ }
+ if (gcov_read_unsigned (file, &version) || version != GCOV_VERSION)
+ {
+ char v[4], e[4];
+
+ magic = GCOV_VERSION;
+ for (ix = 4; ix--; magic >>= 8, version >>= 8)
{
- if (number_arcs-- < 0)
- abort ();
-
- src = i;
- __read_long (&dest, bbg_file, 4);
-
- arcptr = (struct adj_list *) xmalloc (sizeof (struct adj_list));
- init_arc (arcptr, src, dest, bb_graph);
-
- __read_long (&flag_bits, bbg_file, 4);
- if (flag_bits & 0x1)
- arcptr->on_tree++;
- else
- instr_arcs++;
- arcptr->fake = !! (flag_bits & 0x2);
- arcptr->fall_through = !! (flag_bits & 0x4);
+ v[ix] = version;
+ e[ix] = magic;
}
+ fnotice (stderr, "%s:version `%.4s', prefer version `%.4s'\n",
+ da_file_name, v, e);
}
-
- if (number_arcs)
- abort ();
-
- /* Read and ignore the -1 separating the arc list from the arc list of the
- next function. */
- __read_long (&src, bbg_file, 4);
- if (src != -1)
- abort ();
-
- /* Must reverse the order of all succ arcs, to ensure that they match
- the order of the data in the .da file. */
-
- for (i = 0; i < num_blocks; i++)
- if (bb_graph[i].succ)
- bb_graph[i].succ = reverse_arcs (bb_graph[i].succ);
-
- /* Read profile from the .da file. */
-
- profile = read_profile (function_name, cfg_checksum, instr_arcs);
-
- /* For each arc not on the spanning tree, set its execution count from
- the .da file. */
-
- /* The first count in the .da file is the number of times that the function
- was entered. This is the exec_count for block zero. */
-
- /* This duplicates code in branch_prob in profile.c. */
-
- for (i = 0; i < num_blocks; i++)
- for (arcptr = bb_graph[i].succ; arcptr; arcptr = arcptr->succ_next)
- if (! arcptr->on_tree)
+
+ while (1)
+ {
+ unsigned tag, length;
+ long base;
+
+ if (gcov_read_unsigned (file, &tag)
+ || gcov_read_unsigned (file, &length))
{
- arcptr->arc_count = profile[profile_pos++];
- arcptr->count_valid = 1;
- bb_graph[i].succ_count--;
- bb_graph[arcptr->target].pred_count--;
+ if (feof (file))
+ break;
+
+ corrupt:;
+ fnotice (stderr, "%s:corrupted\n", da_file_name);
+ goto cleanup;
}
- free (profile);
- free (function_name);
-}
-
-static void
-solve_program_flow_graph (bptr)
- struct bb_info_list *bptr;
-{
- int passes, changes;
- gcov_type total;
- int i;
- struct adj_list *arcptr;
- struct bb_info *bb_graph;
- int num_blocks;
-
- num_blocks = bptr->num_blocks;
- bb_graph = bptr->bb_graph;
-
- /* For every block in the file,
- - if every exit/entrance arc has a known count, then set the block count
- - if the block count is known, and every exit/entrance arc but one has
- a known execution count, then set the count of the remaining arc
-
- As arc counts are set, decrement the succ/pred count, but don't delete
- the arc, that way we can easily tell when all arcs are known, or only
- one arc is unknown. */
-
- /* The order that the basic blocks are iterated through is important.
- Since the code that finds spanning trees starts with block 0, low numbered
- arcs are put on the spanning tree in preference to high numbered arcs.
- Hence, most instrumented arcs are at the end. Graph solving works much
- faster if we propagate numbers from the end to the start.
-
- This takes an average of slightly more than 3 passes. */
-
- changes = 1;
- passes = 0;
- while (changes)
- {
- passes++;
- changes = 0;
-
- for (i = num_blocks - 1; i >= 0; i--)
+ base = gcov_save_position (file);
+ if (tag == GCOV_TAG_FUNCTION)
{
- if (! bb_graph[i].count_valid)
+ unsigned checksum;
+ struct function_info *fn_n = functions;
+
+ if (gcov_read_string (file, &function_name_buffer, NULL)
+ || gcov_read_unsigned (file, &checksum))
+ goto corrupt;
+
+ for (fn = fn ? fn->next : NULL; ; fn = fn->next)
{
- if (bb_graph[i].succ_count == 0)
- {
- total = 0;
- for (arcptr = bb_graph[i].succ; arcptr;
- arcptr = arcptr->succ_next)
- total += arcptr->arc_count;
- bb_graph[i].exec_count = total;
- bb_graph[i].count_valid = 1;
- changes = 1;
- }
- else if (bb_graph[i].pred_count == 0)
+ if (fn)
+ ;
+ else if ((fn = fn_n))
+ fn_n = NULL;
+ else
{
- total = 0;
- for (arcptr = bb_graph[i].pred; arcptr;
- arcptr = arcptr->pred_next)
- total += arcptr->arc_count;
- bb_graph[i].exec_count = total;
- bb_graph[i].count_valid = 1;
- changes = 1;
+ fnotice (stderr, "%s:unknown function `%s'\n",
+ da_file_name, function_name_buffer);
+ break;
}
+ if (!strcmp (fn->name, function_name_buffer))
+ break;
}
- if (bb_graph[i].count_valid)
+
+ if (!fn)
+ ;
+ else if (checksum != fn->checksum)
{
- if (bb_graph[i].succ_count == 1)
- {
- total = 0;
- /* One of the counts will be invalid, but it is zero,
- so adding it in also doesn't hurt. */
- for (arcptr = bb_graph[i].succ; arcptr;
- arcptr = arcptr->succ_next)
- total += arcptr->arc_count;
- /* Calculate count for remaining arc by conservation. */
- total = bb_graph[i].exec_count - total;
- /* Search for the invalid arc, and set its count. */
- for (arcptr = bb_graph[i].succ; arcptr;
- arcptr = arcptr->succ_next)
- if (! arcptr->count_valid)
- break;
- if (! arcptr)
- abort ();
- arcptr->count_valid = 1;
- arcptr->arc_count = total;
- bb_graph[i].succ_count--;
-
- bb_graph[arcptr->target].pred_count--;
- changes = 1;
- }
- if (bb_graph[i].pred_count == 1)
- {
- total = 0;
- /* One of the counts will be invalid, but it is zero,
- so adding it in also doesn't hurt. */
- for (arcptr = bb_graph[i].pred; arcptr;
- arcptr = arcptr->pred_next)
- total += arcptr->arc_count;
- /* Calculate count for remaining arc by conservation. */
- total = bb_graph[i].exec_count - total;
- /* Search for the invalid arc, and set its count. */
- for (arcptr = bb_graph[i].pred; arcptr;
- arcptr = arcptr->pred_next)
- if (! arcptr->count_valid)
- break;
- if (! arcptr)
- abort ();
- arcptr->count_valid = 1;
- arcptr->arc_count = total;
- bb_graph[i].pred_count--;
-
- bb_graph[arcptr->source].succ_count--;
- changes = 1;
- }
+ mismatch:;
+ fnotice (stderr, "%s:profile mismatch for `%s'\n",
+ da_file_name, function_name_buffer);
+ goto cleanup;
+ }
+ }
+ else if (tag == GCOV_TAG_ARC_COUNTS && fn)
+ {
+ if (length != 8 * fn->num_counts)
+ goto mismatch;
+
+ if (!fn->counts)
+ fn->counts
+ = (gcov_type *)xcalloc (fn->num_counts, sizeof (gcov_type));
+
+ for (ix = 0; ix != fn->num_counts; ix++)
+ {
+ gcov_type count;
+
+ if (gcov_read_counter (file, &count))
+ goto corrupt;
+ fn->counts[ix] += count;
}
}
+ gcov_resync (file, base, length);
}
- /* If the graph has been correctly solved, every block will have a
- succ and pred count of zero. */
- for (i = 0; i < num_blocks; i++)
- if (bb_graph[i].succ_count || bb_graph[i].pred_count)
- abort ();
+ fclose (file);
+ free (function_name_buffer);
+ return 0;
}
+/* Solve the flow graph. Propagate counts from the instrumented arcs
+ to the blocks and the uninstrumented arcs. */
static void
-read_files ()
+solve_flow_graph (fn)
+ function_t *fn;
{
- struct stat buf;
- struct bb_info_list *list_end = 0;
- struct bb_info_list *b_ptr;
-
- while (! feof (bbg_file))
+ unsigned ix;
+ arc_t *arc;
+ gcov_type *count_ptr = fn->counts;
+ block_t *valid_blocks = NULL; /* valid, but unpropagated blocks. */
+ block_t *invalid_blocks = NULL; /* invalid, but inferable blocks. */
+
+ if (fn->num_blocks < 2)
+ fnotice (stderr, "%s:`%s' lacks entry and/or exit blocks\n",
+ bbg_file_name, fn->name);
+ else
{
- b_ptr = (struct bb_info_list *) xmalloc (sizeof (struct bb_info_list));
-
- b_ptr->next = 0;
- if (list_end)
- list_end->next = b_ptr;
+ if (fn->blocks[0].num_pred)
+ fnotice (stderr, "%s:`%s' has arcs to entry block\n",
+ bbg_file_name, fn->name);
else
- bb_graph_list = b_ptr;
- list_end = b_ptr;
-
- /* Read in the data in the .bbg file and reconstruct the program flow
- graph for one function. */
- create_program_flow_graph (b_ptr);
-
- /* Set the EOF condition if at the end of file. */
- ungetc (getc (bbg_file), bbg_file);
+ /* We can't deduce the entry block counts from the lack of
+ predecessors. */
+ fn->blocks[0].num_pred = ~(unsigned)0;
+
+ if (fn->blocks[fn->num_blocks - 1].num_succ)
+ fnotice (stderr, "%s:`%s' has arcs from exit block\n",
+ bbg_file_name, fn->name);
+ else
+ /* Likewise, we can't deduce exit block counts from the lack
+ of its successors. */
+ fn->blocks[fn->num_blocks - 1].num_succ = ~(unsigned)0;
}
- /* Calculate all of the basic block execution counts and branch
- taken probabilities. */
-
- for (b_ptr = bb_graph_list; b_ptr; b_ptr = b_ptr->next)
- solve_program_flow_graph (b_ptr);
-
- /* Read in all of the data from the .bb file. This info will be accessed
- sequentially twice. */
- stat (bb_file_name, &buf);
- bb_data_size = buf.st_size / 4;
-
- bb_data = (char *) xmalloc ((unsigned) buf.st_size);
- fread (bb_data, sizeof (char), buf.st_size, bb_file);
-
- fclose (bb_file);
- if (da_file)
- fclose (da_file);
- fclose (bbg_file);
-}
-
-
-/* Scan the data in the .bb file to find all source files referenced,
- and the largest line number mentioned in each one. */
-
-static void
-scan_for_source_files ()
-{
- struct sourcefile *s_ptr = NULL;
- char *ptr;
- long count;
- long line_num;
-
- /* Search the bb_data to find:
- 1) The number of sources files contained herein, and
- 2) The largest line number for each source file. */
-
- ptr = bb_data;
- sources = 0;
- for (count = 0; count < bb_data_size; count++)
+ /* Propagate the measured counts, this must be done in the same
+ order as the code in profile.c */
+ for (ix = 0; ix != fn->num_blocks; ix++)
{
- __fetch_long (&line_num, ptr, 4);
- ptr += 4;
- if (line_num == -1)
+ block_t const *prev_dst = NULL;
+ int out_of_order = 0;
+
+ for (arc = fn->blocks[ix].succ; arc; arc = arc->succ_next)
{
- /* A source file name follows. Check to see if we already have
- a sourcefile structure for this file. */
- s_ptr = sources;
- while (s_ptr && strcmp (s_ptr->name, ptr))
- s_ptr = s_ptr->next;
-
- if (s_ptr == 0)
+ if (!arc->on_tree)
{
- /* No sourcefile structure for this file name exists, create
- a new one, and append it to the front of the sources list. */
- s_ptr = (struct sourcefile *) xmalloc (sizeof(struct sourcefile));
- s_ptr->name = xstrdup (ptr);
- s_ptr->maxlineno = 0;
- s_ptr->next = sources;
- sources = s_ptr;
+ if (count_ptr)
+ arc->count = *count_ptr++;
+ arc->count_valid = 1;
+ fn->blocks[ix].num_succ--;
+ arc->dst->num_pred--;
}
-
- /* Scan past the file name. */
- {
- long delim;
- do {
- count++;
- __fetch_long (&delim, ptr, 4);
- ptr += 4;
- } while (delim != line_num);
- }
+ if (prev_dst && prev_dst > arc->dst)
+ out_of_order = 1;
+ prev_dst = arc->dst;
}
- else if (line_num == -2)
+
+ /* Sort the successor arcs into ascending dst order. profile.c
+ normally produces arcs in the right order, but sometimes with
+ one or two out of order. We're not using a particularly
+ smart sort. */
+ if (out_of_order)
{
- long delim;
-
- /* A function name follows. Ignore it. */
- do {
- count++;
- __fetch_long (&delim, ptr, 4);
- ptr += 4;
- } while (delim != line_num);
+ arc_t *start = fn->blocks[ix].succ;
+ unsigned changes = 1;
+
+ while (changes)
+ {
+ arc_t *arc, *arc_p, *arc_n;
+
+ changes = 0;
+ for (arc_p = NULL, arc = start; (arc_n = arc->succ_next);)
+ {
+ if (arc->dst > arc_n->dst)
+ {
+ changes = 1;
+ if (arc_p)
+ arc_p->succ_next = arc_n;
+ else
+ start = arc_n;
+ arc->succ_next = arc_n->succ_next;
+ arc_n->succ_next = arc;
+ arc_p = arc_n;
+ }
+ else
+ {
+ arc_p = arc;
+ arc = arc_n;
+ }
+ }
+ }
+ fn->blocks[ix].succ = start;
}
- /* There will be a zero before the first file name, in which case s_ptr
- will still be uninitialized. So, only try to set the maxlineno
- field if line_num is nonzero. */
- else if (line_num > 0)
+
+ /* Place it on the invalid chain, it will be ignored if that's
+ wrong. */
+ fn->blocks[ix].invalid_chain = 1;
+ fn->blocks[ix].chain = invalid_blocks;
+ invalid_blocks = &fn->blocks[ix];
+ }
+
+ while (invalid_blocks || valid_blocks)
+ {
+ block_t *blk;
+
+ while ((blk = invalid_blocks))
{
- if (s_ptr->maxlineno <= line_num)
- s_ptr->maxlineno = line_num + 1;
+ gcov_type total = 0;
+ const arc_t *arc;
+
+ invalid_blocks = blk->chain;
+ blk->invalid_chain = 0;
+ if (!blk->num_succ)
+ for (arc = blk->succ; arc; arc = arc->succ_next)
+ total += arc->count;
+ else if (!blk->num_pred)
+ for (arc = blk->pred; arc; arc = arc->pred_next)
+ total += arc->count;
+ else
+ continue;
+
+ blk->count = total;
+ blk->count_valid = 1;
+ blk->chain = valid_blocks;
+ blk->valid_chain = 1;
+ valid_blocks = blk;
}
- else if (line_num < 0)
+ while ((blk = valid_blocks))
{
- /* Don't know what this is, but it's garbage. */
- abort ();
+ gcov_type total;
+ arc_t *arc, *inv_arc;
+
+ valid_blocks = blk->chain;
+ blk->valid_chain = 0;
+ if (blk->num_succ == 1)
+ {
+ block_t *dst;
+
+ total = blk->count;
+ inv_arc = NULL;
+ for (arc = blk->succ; arc; arc = arc->succ_next)
+ {
+ total -= arc->count;
+ if (!arc->count_valid)
+ inv_arc = arc;
+ }
+ dst = inv_arc->dst;
+ inv_arc->count_valid = 1;
+ inv_arc->count = total;
+ blk->num_succ--;
+ dst->num_pred--;
+ if (dst->count_valid)
+ {
+ if (dst->num_pred == 1 && !dst->valid_chain)
+ {
+ dst->chain = valid_blocks;
+ dst->valid_chain = 1;
+ valid_blocks = dst;
+ }
+ }
+ else
+ {
+ if (!dst->num_pred && !dst->invalid_chain)
+ {
+ dst->chain = invalid_blocks;
+ dst->invalid_chain = 1;
+ invalid_blocks = dst;
+ }
+ }
+ }
+ if (blk->num_pred == 1)
+ {
+ block_t *src;
+
+ total = blk->count;
+ inv_arc = NULL;
+ for (arc = blk->pred; arc; arc = arc->pred_next)
+ {
+ total -= arc->count;
+ if (!arc->count_valid)
+ inv_arc = arc;
+ }
+ src = inv_arc->src;
+ inv_arc->count_valid = 1;
+ inv_arc->count = total;
+ blk->num_pred--;
+ src->num_succ--;
+ if (src->count_valid)
+ {
+ if (src->num_succ == 1 && !src->valid_chain)
+ {
+ src->chain = valid_blocks;
+ src->valid_chain = 1;
+ valid_blocks = src;
+ }
+ }
+ else
+ {
+ if (!src->num_succ && !src->invalid_chain)
+ {
+ src->chain = invalid_blocks;
+ src->invalid_chain = 1;
+ invalid_blocks = src;
+ }
+ }
+ }
}
}
+
+ /* If the graph has been correctly solved, every block will have a
+ valid count. */
+ for (ix = 0; ix < fn->num_blocks; ix++)
+ if (!fn->blocks[ix].count_valid)
+ {
+ fnotice (stderr, "%s:graph is unsolvable for `%s'\n",
+ bbg_file_name, fn->name);
+ break;
+ }
}
+
-/* Increment totals in FUNCTION according to arc A_PTR. */
+/* Increment totals in COVERAGE according to arc ARC. */
static void
-accumulate_branch_counts (function, a_ptr)
- struct coverage *function;
- struct arcdata *a_ptr;
+add_branch_counts (coverage, arc)
+ coverage_t *coverage;
+ const arc_t *arc;
{
- if (a_ptr->call_insn)
+ if (arc->is_call)
{
- function->calls++;
- if (a_ptr->total)
- function->calls_executed++;
+ coverage->calls++;
+ if (arc->src->count)
+ coverage->calls_executed++;
}
else
{
- function->branches++;
- if (a_ptr->total)
- function->branches_executed++;
- if (a_ptr->hits)
- function->branches_taken++;
- }
-}
-
-/* Calculate the branch taken probabilities for all arcs branches at the
- end of this block. */
-
-static void
-calculate_branch_probs (block_ptr, line_info, function)
- struct bb_info *block_ptr;
- struct line_info *line_info;
- struct coverage *function;
-{
- gcov_type total;
- struct adj_list *arcptr;
-
- total = block_ptr->exec_count;
- for (arcptr = block_ptr->succ; arcptr; arcptr = arcptr->succ_next)
- {
- struct arcdata *a_ptr;
-
- /* Ignore fall through arcs as they aren't really branches. */
- if (arcptr->fall_through)
- continue;
-
- a_ptr = (struct arcdata *) xmalloc (sizeof (struct arcdata));
- a_ptr->total = total;
- a_ptr->hits = total ? arcptr->arc_count : 0;
- a_ptr->call_insn = arcptr->fake;
-
- if (function)
- accumulate_branch_counts (function, a_ptr);
- /* Prepend the new branch to the list. */
- a_ptr->next = line_info->branches;
- line_info->branches = a_ptr;
+ coverage->branches++;
+ if (arc->src->count)
+ coverage->branches_executed++;
+ if (arc->count)
+ coverage->branches_taken++;
}
}
@@ -1134,8 +1219,8 @@ calculate_branch_probs (block_ptr, line_info, function)
format TOP. Return pointer to a static string. */
static char const *
-format_hwint (top, bottom, dp)
- HOST_WIDEST_INT top, bottom;
+format_gcov (top, bottom, dp)
+ gcov_type top, bottom;
int dp;
{
static char buffer[20];
@@ -1169,7 +1254,7 @@ format_hwint (top, bottom, dp)
}
}
else
- sprintf (buffer, HOST_WIDEST_INT_PRINT_DEC, top);
+ sprintf (buffer, HOST_WIDEST_INT_PRINT_DEC, (HOST_WIDEST_INT)top);
return buffer;
}
@@ -1178,42 +1263,40 @@ format_hwint (top, bottom, dp)
/* Output summary info for a function. */
static void
-function_summary (function, title)
- struct coverage *function;
+function_summary (coverage, title)
+ const coverage_t *coverage;
const char *title;
{
- if (function->lines)
- fnotice (stdout, "%s of %d lines executed in %s %s\n",
- format_hwint (function->lines_executed,
- function->lines, 2),
- function->lines, title, function->name);
+ fnotice (stdout, "%s `%s'\n", title, coverage->name);
+
+ if (coverage->lines)
+ fnotice (stdout, "Lines executed:%s of %d\n",
+ format_gcov (coverage->lines_executed, coverage->lines, 2),
+ coverage->lines);
else
- fnotice (stdout, "No executable lines in %s %s\n",
- title, function->name);
+ fnotice (stdout, "No executable lines");
- if (output_branch_probs)
+ if (flag_branches)
{
- if (function->branches)
+ if (coverage->branches)
{
- fnotice (stdout, "%s of %d branches executed in %s %s\n",
- format_hwint (function->branches_executed,
- function->branches, 2),
- function->branches, title, function->name);
- fnotice (stdout,
- "%s of %d branches taken at least once in %s %s\n",
- format_hwint (function->branches_taken,
- function->branches, 2),
- function->branches, title, function->name);
+ fnotice (stdout, "Branches executed:%s of %d\n",
+ format_gcov (coverage->branches_executed,
+ coverage->branches, 2),
+ coverage->branches);
+ fnotice (stdout, "Taken at least once:%s of %d\n",
+ format_gcov (coverage->branches_taken,
+ coverage->branches, 2),
+ coverage->branches);
}
else
- fnotice (stdout, "No branches in %s %s\n", title, function->name);
- if (function->calls)
- fnotice (stdout, "%s of %d calls executed in %s %s\n",
- format_hwint (function->calls_executed,
- function->calls, 2),
- function->calls, title, function->name);
+ fnotice (stdout, "No branches\n");
+ if (coverage->calls)
+ fnotice (stdout, "Calls executed:%s of %d\n",
+ format_gcov (coverage->calls_executed, coverage->calls, 2),
+ coverage->calls);
else
- fnotice (stdout, "No calls in %s %s\n", title, function->name);
+ fnotice (stdout, "No calls\n");
}
}
@@ -1228,28 +1311,27 @@ function_summary (function, title)
removed and '..' components are renamed to '^'. */
static char *
-make_gcov_file_name (src_name)
- char *src_name;
+make_gcov_file_name (input_name, src_name)
+ const char *input_name;
+ const char *src_name;
{
char *cptr;
- char *name = xmalloc (strlen (src_name) + strlen (input_file_name) + 10);
+ char *name = xmalloc (strlen (src_name) + strlen (input_name) + 10);
name[0] = 0;
- if (output_long_names && strcmp (src_name, input_file_name))
+ if (flag_long_names && strcmp (src_name, input_name))
{
/* Generate the input filename part. */
- cptr = preserve_paths ? NULL : strrchr (input_file_name, '/');
- cptr = cptr ? cptr + 1 : input_file_name;
- strcat (name, cptr);
+ cptr = flag_preserve_paths ? NULL : strrchr (input_name, '/');
+ strcat (name, cptr ? cptr + 1 : input_name);
strcat (name, "##");
}
/* Generate the source filename part. */
- cptr = preserve_paths ? NULL : strrchr (src_name, '/');
- cptr = cptr ? cptr + 1 : src_name;
- strcat (name, cptr);
+ cptr = flag_preserve_paths ? NULL : strrchr (src_name, '/');
+ strcat (name, cptr ? cptr + 1 : src_name);
- if (preserve_paths)
+ if (flag_preserve_paths)
{
/* Convert '/' to '#', remove '/./', convert '/../' to '/^/' */
char *prev;
@@ -1281,166 +1363,106 @@ make_gcov_file_name (src_name)
}
}
- /* Don't strip off the ending for compatibility with tcov, since
- this results in confusion if there is more than one file with the
- same basename, e.g. tmp.c and tmp.h. */
strcat (name, ".gcov");
return name;
}
-/* Scan through the bb_data, and when the file name matches the
- source file name, then for each following line number, increment
+/* Scan through the bb_data for each line in the block, increment
the line number execution count indicated by the execution count of
the appropriate basic block. */
static void
-init_line_info (line_info, total, maxlineno)
- struct line_info *line_info;
- struct coverage *total;
- long maxlineno;
+add_line_counts (coverage, fn)
+ coverage_t *coverage;
+ const function_t *fn;
{
- long block_num = 0; /* current block number */
- struct bb_info *block_ptr = NULL; /* current block ptr */
- struct coverage function;
- struct coverage *func_ptr = NULL;
- struct bb_info_list *current_graph = NULL; /* Graph for current function. */
- int is_this_file = 0; /* We're scanning a block from the desired file. */
- char *ptr = bb_data;
- long count;
- long line_num;
- struct line_info *line_ptr = 0; /* line info ptr. */
-
- memset (&function, 0, sizeof (function));
- if (output_function_summary)
- func_ptr = &function;
-
- for (count = 0; count < bb_data_size; count++)
+ unsigned ix;
+ line_t *line = NULL; /* this is propagated from one iteration to the
+ next. */
+
+ /* Scan each basic block. */
+ for (ix = 0; ix != fn->num_blocks; ix++)
{
- __fetch_long (&line_num, ptr, 4);
- ptr += 4;
- if (line_num < 0)
- {
- long delim;
-
- if (line_num == -1)
- {
- /* Marks the beginning of a file name. Check to see
- whether this is the filename we are currently
- collecting data for. */
- is_this_file = !strcmp (total->name, ptr);
- }
- else if (line_num == -2)
- {
- /* Marks the start of a new function. Advance to the
- next program flow graph. */
- if (!current_graph)
- current_graph = bb_graph_list;
- else
- {
- if (block_num == current_graph->num_blocks - 1)
- /* Last block falls through to exit. */
- ;
- else if (block_num == current_graph->num_blocks - 2)
- {
- if (output_branch_probs && is_this_file)
- calculate_branch_probs (block_ptr, line_ptr, func_ptr);
- }
- else
- {
- fnotice (stderr,
- "didn't use all bb entries of graph, function %s\n",
- function.name);
- fnotice (stderr, "block_num = %ld, num_blocks = %d\n",
- block_num, current_graph->num_blocks);
- }
- if (func_ptr && is_this_file)
- function_summary (func_ptr, "function");
- current_graph = current_graph->next;
- }
- block_num = 0;
- block_ptr = current_graph->bb_graph;
- memset (&function, 0, sizeof (function));
- function.name = ptr;
- }
- else
- {
- fnotice (stderr, "ERROR: unexpected line number %ld\n", line_num);
- abort ();
- }
+ const block_t *block = &fn->blocks[ix];
+ unsigned *encoding;
+ const source_t *src = NULL;
+ unsigned jx;
+
+ for (jx = 0, encoding = block->encoding;
+ jx != block->num_encodings; jx++, encoding++)
+ if (!*encoding)
+ {
+ unsigned src_n = *++encoding;
- /* Scan past the string. */
- for (delim = 0; delim != line_num; count++)
- {
- __fetch_long (&delim, ptr, 4);
- ptr += 4;
- }
- }
- else if (!line_num)
+ for (src = sources; src->index != src_n; src = src->next)
+ continue;
+ jx++;
+ }
+ else
+ {
+ line = &src->lines[*encoding];
+
+ if (coverage)
+ {
+ if (!line->exists)
+ coverage->lines++;
+ if (!line->count && block->count)
+ coverage->lines_executed++;
+ }
+ line->exists = 1;
+ line->count += block->count;
+ }
+
+ if (line && flag_branches)
{
- /* Marks the end of a block. */
- if (block_num >= current_graph->num_blocks)
- {
- fnotice (stderr, "ERROR: too many basic blocks in function %s\n",
- function.name);
- abort ();
- }
-
- if (output_branch_probs && is_this_file)
- calculate_branch_probs (block_ptr, line_ptr, func_ptr);
+ arc_t *arc;
- block_num++;
- block_ptr++;
- }
- else if (is_this_file)
- {
- if (line_num >= maxlineno)
- {
- fnotice (stderr, "ERROR: out of range line number in function %s\n",
- function.name);
- abort ();
- }
-
- line_ptr = &line_info[line_num];
- if (func_ptr)
+ for (arc = block->succ; arc; arc = arc->succ_next)
{
- if (!line_ptr->exists)
- func_ptr->lines++;
- if (!line_ptr->count && block_ptr->exec_count)
- func_ptr->lines_executed++;
+ /* Ignore fall through arcs as they aren't really branches. */
+ if (arc->fall_through)
+ continue;
+
+ arc->line_next = line->branches;
+ line->branches = arc;
+ if (coverage)
+ add_branch_counts (coverage, arc);
}
-
- /* Accumulate execution data for this line number. */
- line_ptr->count += block_ptr->exec_count;
- line_ptr->exists = 1;
}
}
+ if (!line)
+ fnotice (stderr, "%s:no lines for `%s'\n", bbg_file_name, fn->name);
+}
+
+/* Accumulate the line counts of a file. */
+
+static void
+accumulate_line_counts (src)
+ source_t *src;
+{
+ line_t *line;
+ unsigned ix;
- if (func_ptr && is_this_file)
- function_summary (func_ptr, "function");
-
- /* Calculate summary test coverage statistics. */
- for (line_num = 1, line_ptr = &line_info[line_num];
- line_num < maxlineno; line_num++, line_ptr++)
+ for (ix = src->num_lines, line = src->lines; ix--; line++)
{
- struct arcdata *a_ptr, *prev, *next;
+ arc_t *arc, *arc_p, *arc_n;
- if (line_ptr->exists)
+ /* Total and reverse the branch information. */
+ for (arc = line->branches, arc_p = NULL; arc; arc_p = arc, arc = arc_n)
{
- total->lines++;
- if (line_ptr->count)
- total->lines_executed++;
+ arc_n = arc->line_next;
+ arc->line_next = arc_p;
+
+ add_branch_counts (&src->coverage, arc);
}
+ line->branches = arc_p;
- /* Total and reverse the branch information. */
- for (a_ptr = line_ptr->branches, prev = NULL; a_ptr; a_ptr = next)
+ if (line->exists)
{
- next = a_ptr->next;
- a_ptr->next = prev;
- prev = a_ptr;
-
- accumulate_branch_counts (total, a_ptr);
+ src->coverage.lines++;
+ if (line->count)
+ src->coverage.lines_executed++;
}
- line_ptr->branches = prev;
}
}
@@ -1449,25 +1471,24 @@ init_line_info (line_info, total, maxlineno)
information. */
static void
-output_line_info (gcov_file, line_info, total, maxlineno)
+output_lines (gcov_file, src)
FILE *gcov_file;
- const struct line_info *line_info;
- const struct coverage *total;
- long maxlineno;
+ const source_t *src;
{
FILE *source_file;
- long line_num; /* current line number */
- const struct line_info *line_ptr; /* current line info ptr. */
- char string[STRING_SIZE]; /* line buffer. */
- char const *retval = ""; /* status of source file reading. */
-
- fprintf (gcov_file, "%9s:%5d:Source:%s\n", "-", 0, total->name);
- fprintf (gcov_file, "%9s:%5d:Object:%s\n", "-", 0, bb_file_name);
+ unsigned line_num; /* current line number. */
+ const line_t *line; /* current line info ptr. */
+ char string[STRING_SIZE]; /* line buffer. */
+ char const *retval = ""; /* status of source file reading. */
+
+ fprintf (gcov_file, "%9s:%5d:Source:%s\n", "-", 0, src->name);
+ fprintf (gcov_file, "%9s:%5d:Graph:%s\n", "-", 0, bbg_file_name);
+ fprintf (gcov_file, "%9s:%5d:Data:%s\n", "-", 0, da_file_name);
- source_file = fopen (total->name, "r");
+ source_file = fopen (src->name, "r");
if (!source_file)
{
- fnotice (stderr, "Could not open source file %s.\n", total->name);
+ fnotice (stderr, "%s:cannot open source file\n", src->name);
retval = NULL;
}
else
@@ -1475,17 +1496,17 @@ output_line_info (gcov_file, line_info, total, maxlineno)
struct stat status;
if (!fstat (fileno (source_file), &status)
- && status.st_mtime > bb_file_time)
+ && status.st_mtime > bbg_file_time)
{
- fnotice (stderr, "Warning: source file %s is newer than %s\n",
- total->name, bb_file_name);
- fprintf (gcov_file, "%9s:%5d:Source is newer than compiler output\n",
+ fnotice (stderr, "%s:source file is newer than graph file `%s'\n",
+ src->name, bbg_file_name);
+ fprintf (gcov_file, "%9s:%5d:Source is newer than graph\n",
"-", 0);
}
}
- for (line_num = 1, line_ptr = &line_info[line_num];
- line_num < maxlineno; line_num++, line_ptr++)
+ for (line_num = 1, line = &src->lines[line_num];
+ line_num < src->num_lines; line_num++, line++)
{
/* For lines which don't exist in the .bb file, print '-' before
the source line. For lines which exist but were never
@@ -1493,10 +1514,9 @@ output_line_info (gcov_file, line_info, total, maxlineno)
print the execution count before the source line. There are
16 spaces of indentation added before the source line so that
tabs won't be messed up. */
- fprintf (gcov_file, "%9s:%5ld:",
- !line_ptr->exists ? "-"
- : !line_ptr->count ? "#####"
- : format_hwint (line_ptr->count, 0, -1), line_num);
+ fprintf (gcov_file, "%9s:%5u:",
+ !line->exists ? "-" : !line->count ? "#####"
+ : format_gcov (line->count, 0, -1), line_num);
if (retval)
{
@@ -1506,9 +1526,7 @@ output_line_info (gcov_file, line_info, total, maxlineno)
retval = fgets (string, STRING_SIZE, source_file);
if (!retval)
{
- fnotice (stderr,
- "Unexpected EOF while reading source file %s.\n",
- total->name);
+ fnotice (stderr, "%s:unexpected EOF\n", src->name);
break;
}
fputs (retval, gcov_file);
@@ -1518,34 +1536,33 @@ output_line_info (gcov_file, line_info, total, maxlineno)
if (!retval)
fputs ("??\n", gcov_file);
- if (output_branch_probs)
+ if (flag_branches)
{
- int i;
- struct arcdata *a_ptr;
+ int ix;
+ arc_t *arc;
- for (i = 0, a_ptr = line_ptr->branches; a_ptr;
- a_ptr = a_ptr->next, i++)
+ for (ix = 0, arc = line->branches; arc; arc = arc->line_next, ix++)
{
- if (a_ptr->call_insn)
+ if (arc->is_call)
{
- if (a_ptr->total == 0)
- fnotice (gcov_file, "call %2d never executed\n", i);
- else
+ if (arc->src->count)
fnotice
- (gcov_file, "call %2d returns %s\n", i,
- format_hwint (a_ptr->total - a_ptr->hits,
- a_ptr->total,
- -output_branch_counts));
+ (gcov_file, "call %2d returns %s\n", ix,
+ format_gcov (arc->src->count - arc->count,
+ arc->src->count,
+ -flag_counts));
+ else
+ fnotice (gcov_file, "call %2d never executed\n", ix);
}
else
{
- if (a_ptr->total == 0)
- fnotice (gcov_file, "branch %2d never executed\n", i);
- else
+ if (arc->src->count)
fnotice
- (gcov_file, "branch %2d taken %s\n", i,
- format_hwint (a_ptr->hits, a_ptr->total,
- -output_branch_counts));
+ (gcov_file, "branch %2d taken %s\n", ix,
+ format_gcov (arc->count, arc->src->count,
+ -flag_counts));
+ else
+ fnotice (gcov_file, "branch %2d never executed\n", ix);
}
}
}
@@ -1557,7 +1574,7 @@ output_line_info (gcov_file, line_info, total, maxlineno)
{
for (; (retval = fgets (string, STRING_SIZE, source_file)); line_num++)
{
- fprintf (gcov_file, "%9s:%5ld:%s", "-", line_num, retval);
+ fprintf (gcov_file, "%9s:%5u:%s", "-", line_num, retval);
while (!retval[0] || retval[strlen (retval) - 1] != '\n')
{
@@ -1572,63 +1589,3 @@ output_line_info (gcov_file, line_info, total, maxlineno)
if (source_file)
fclose (source_file);
}
-
-/* Calculate line execution counts, and output a .gcov file for source
- file S_PTR. Allocate an array big enough to hold a count for each
- line. Scan through the bb_data, and when the file name matches the
- current file name, then for each following line number, increment
- the line number execution count indicated by the execution count of
- the appropriate basic block. */
-
-static void
-output_data (s_ptr)
- struct sourcefile *s_ptr;
-{
- struct line_info *line_info /* line info data */
- = (struct line_info *) xcalloc (s_ptr->maxlineno,
- sizeof (struct line_info));
- long line_num;
- struct coverage total;
-
- memset (&total, 0, sizeof (total));
- total.name = s_ptr->name;
-
- init_line_info (line_info, &total, s_ptr->maxlineno);
- function_summary (&total, "file");
-
- if (output_gcov_file)
- {
- /* Now the statistics are ready. Read in the source file one
- line at a time, and output that line to the gcov file
- preceded by its execution information. */
-
- char *gcov_file_name = make_gcov_file_name (total.name);
- FILE *gcov_file = fopen (gcov_file_name, "w");
-
- if (gcov_file)
- {
- fnotice (stdout, "Creating %s.\n", gcov_file_name);
- output_line_info (gcov_file, line_info, &total, s_ptr->maxlineno);
- if (ferror (gcov_file))
- fnotice (stderr, "Error writing output file %s.\n",
- gcov_file_name);
- fclose (gcov_file);
- }
- else
- fnotice (stderr, "Could not open output file %s.\n", gcov_file_name);
- free (gcov_file_name);
- }
-
- /* Free data. */
- for (line_num = 1; line_num != s_ptr->maxlineno; line_num++)
- {
- struct arcdata *branch, *next;
-
- for (branch = line_info[line_num].branches; branch; branch = next)
- {
- next = branch->next;
- free (branch);
- }
- }
- free (line_info);
-}
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 9e4cccb136e..400df2df005 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -145,6 +145,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "toplev.h"
#include "rtl.h"
@@ -719,10 +721,6 @@ gcse_main (f, file)
/* Point to release obstack data from for each pass. */
char *gcse_obstack_bottom;
- /* Insertion of instructions on edges can create new basic blocks; we
- need the original basic block count so that we can properly deallocate
- arrays sized on the number of basic blocks originally in the cfg. */
- int orig_bb_count;
/* We do not construct an accurate cfg in functions which call
setjmp, so just punt to be safe. */
if (current_function_calls_setjmp)
@@ -742,7 +740,6 @@ gcse_main (f, file)
if (file)
dump_flow_info (file);
- orig_bb_count = n_basic_blocks;
/* Return if there's nothing to do. */
if (n_basic_blocks <= 1)
return 0;
@@ -841,7 +838,6 @@ gcse_main (f, file)
= (rtx *) gmalloc (last_basic_block * sizeof (rtx));
memset ((char *) modify_mem_list, 0, last_basic_block * sizeof (rtx));
memset ((char *) canon_modify_mem_list, 0, last_basic_block * sizeof (rtx));
- orig_bb_count = n_basic_blocks;
}
free_reg_set_mem ();
alloc_reg_set_mem (max_reg_num ());
diff --git a/gcc/gen-protos.c b/gcc/gen-protos.c
index 96aeef9ed25..a7814429130 100644
--- a/gcc/gen-protos.c
+++ b/gcc/gen-protos.c
@@ -16,8 +16,10 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "scan.h"
#undef abort
diff --git a/gcc/genattr.c b/gcc/genattr.c
index 591e0d7997e..02c5c345d51 100644
--- a/gcc/genattr.c
+++ b/gcc/genattr.c
@@ -20,8 +20,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "errors.h"
#include "gensupport.h"
diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c
index 47a6f00c25e..266fc41b782 100644
--- a/gcc/genattrtab.c
+++ b/gcc/genattrtab.c
@@ -100,8 +100,10 @@ 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))
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "ggc.h"
#include "gensupport.h"
@@ -2562,11 +2564,10 @@ simplify_cond (exp, insn_code, insn_index)
int len = XVECLEN (exp, 0);
rtx *tests = (rtx *) xmalloc (len * sizeof (rtx));
int allsame = 1;
- char *first_spacer;
rtx ret;
/* This lets us free all storage allocated below, if appropriate. */
- first_spacer = (char *) obstack_finish (rtl_obstack);
+ obstack_finish (rtl_obstack);
memcpy (tests, XVEC (exp, 0)->elem, len * sizeof (rtx));
@@ -6169,6 +6170,8 @@ from the machine description file `md'. */\n\n");
printf ("#include \"config.h\"\n");
printf ("#include \"system.h\"\n");
+ printf ("#include \"coretypes.h\"\n");
+ printf ("#include \"tm.h\"\n");
printf ("#include \"rtl.h\"\n");
printf ("#include \"tm_p.h\"\n");
printf ("#include \"insn-config.h\"\n");
diff --git a/gcc/genautomata.c b/gcc/genautomata.c
index 8c48d6ad637..95f5789afa3 100644
--- a/gcc/genautomata.c
+++ b/gcc/genautomata.c
@@ -100,8 +100,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
function are used by gcc instruction scheduler and may be some
other gcc code. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "obstack.h"
#include "errors.h"
@@ -3581,9 +3583,6 @@ static vla_ptr_t units_container;
/* The start address of the array. */
static unit_decl_t *units_array;
-/* Empty reservation of maximal length. */
-static reserv_sets_t empty_reserv;
-
/* The state table itself is represented by the following variable. */
static htab_t state_table;
@@ -4147,10 +4146,10 @@ initiate_states ()
initiate_alt_states ();
VLA_PTR_CREATE (free_states, 1500, "free states");
state_table = htab_create (1500, state_hash, state_eq_p, (htab_del) 0);
- empty_reserv = alloc_empty_reserv_sets ();
+ alloc_empty_reserv_sets ();
}
-/* Finisging work with the abstract data. */
+/* Finishing work with the abstract data. */
static void
finish_states ()
{
diff --git a/gcc/gencheck.c b/gcc/gencheck.c
index 9eda355fa37..8041b64ade2 100644
--- a/gcc/gencheck.c
+++ b/gcc/gencheck.c
@@ -18,8 +18,10 @@ 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 "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#define DEFTREECODE(SYM, NAME, TYPE, LEN) STRINGX(SYM),
diff --git a/gcc/gencodes.c b/gcc/gencodes.c
index 5a292821c39..e2c4656624b 100644
--- a/gcc/gencodes.c
+++ b/gcc/gencodes.c
@@ -22,8 +22,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "errors.h"
#include "gensupport.h"
diff --git a/gcc/genconditions.c b/gcc/genconditions.c
index 02f80ee478d..bc52cb3fc67 100644
--- a/gcc/genconditions.c
+++ b/gcc/genconditions.c
@@ -26,8 +26,10 @@
most of the programs that generate code from the machine
description can simply ignore the entire pattern. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "errors.h"
#include "hashtab.h"
@@ -73,7 +75,7 @@ write_header ()
/* Generated automatically by the program `genconditions' from the target\n\
machine description file. */\n\
\n\
-#include \"hconfig.h\"\n\
+#include \"bconfig.h\"\n\
#include \"insn-constants.h\"\n");
puts ("\
@@ -87,6 +89,8 @@ write_header ()
puts ("\
#include \"system.h\"\n\
+#include \"coretypes.h\"\n\
+#include \"tm.h\"\n\
#include \"rtl.h\"\n\
#include \"tm_p.h\"\n\
#include \"function.h\"\n");
diff --git a/gcc/genconfig.c b/gcc/genconfig.c
index 795e3120356..ca74757364e 100644
--- a/gcc/genconfig.c
+++ b/gcc/genconfig.c
@@ -21,8 +21,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "errors.h"
#include "gensupport.h"
diff --git a/gcc/genconstants.c b/gcc/genconstants.c
index 9208f0c0009..1c08040f8ec 100644
--- a/gcc/genconstants.c
+++ b/gcc/genconstants.c
@@ -26,8 +26,10 @@ Boston, MA 02111-1307, USA. */
look at insn patterns, only (define_constants), and we want to
minimize dependencies. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "errors.h"
#include "gensupport.h"
diff --git a/gcc/genemit.c b/gcc/genemit.c
index cb6c06ccd18..cb15f699d29 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -20,8 +20,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "errors.h"
#include "gensupport.h"
@@ -826,6 +828,8 @@ from the machine description file `md'. */\n\n");
printf ("#include \"config.h\"\n");
printf ("#include \"system.h\"\n");
+ printf ("#include \"coretypes.h\"\n");
+ printf ("#include \"tm.h\"\n");
printf ("#include \"rtl.h\"\n");
printf ("#include \"tm_p.h\"\n");
printf ("#include \"function.h\"\n");
diff --git a/gcc/genextract.c b/gcc/genextract.c
index d52fc36f2d0..912aa78c52d 100644
--- a/gcc/genextract.c
+++ b/gcc/genextract.c
@@ -20,8 +20,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "errors.h"
#include "insn-config.h"
@@ -375,6 +377,8 @@ from the machine description file `md'. */\n\n");
printf ("#include \"config.h\"\n");
printf ("#include \"system.h\"\n");
+ printf ("#include \"coretypes.h\"\n");
+ printf ("#include \"tm.h\"\n");
printf ("#include \"rtl.h\"\n");
printf ("#include \"insn-config.h\"\n");
printf ("#include \"recog.h\"\n");
diff --git a/gcc/genflags.c b/gcc/genflags.c
index 94806816762..ec90c1a6241 100644
--- a/gcc/genflags.c
+++ b/gcc/genflags.c
@@ -22,8 +22,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "obstack.h"
#include "errors.h"
diff --git a/gcc/gengenrtl.c b/gcc/gengenrtl.c
index 6bfd0ff77ee..b6ecfc5e7e3 100644
--- a/gcc/gengenrtl.c
+++ b/gcc/gengenrtl.c
@@ -19,8 +19,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#define NO_GENRTL_H
#include "rtl.h"
@@ -333,6 +335,8 @@ gencode ()
puts ("#include \"config.h\"");
puts ("#include \"system.h\"");
+ puts ("#include \"coretypes.h\"");
+ puts ("#include \"tm.h\"");
puts ("#include \"obstack.h\"");
puts ("#include \"rtl.h\"");
puts ("#include \"ggc.h\"\n");
diff --git a/gcc/gengtype-lex.l b/gcc/gengtype-lex.l
index 91cdde29580..25877cff4d0 100644
--- a/gcc/gengtype-lex.l
+++ b/gcc/gengtype-lex.l
@@ -23,7 +23,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define malloc xmalloc
#define realloc xrealloc
-#include "hconfig.h"
+#include "bconfig.h"
+#include "coretypes.h"
+#include "system.h"
#include "system.h"
#include "gengtype.h"
#include "gengtype-yacc.h"
diff --git a/gcc/gengtype-yacc.y b/gcc/gengtype-yacc.y
index bb350b43e59..c705315c341 100644
--- a/gcc/gengtype-yacc.y
+++ b/gcc/gengtype-yacc.y
@@ -20,8 +20,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
%{
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "gengtype.h"
#define YYERROR_VERBOSE
%}
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index dbd8995774b..79542e6a621 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -18,8 +18,10 @@ 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 "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "gengtype.h"
#include "gtyp-gen.h"
@@ -1115,11 +1117,11 @@ open_base_files ()
{
/* The order of files here matters very much. */
static const char *const ifiles [] = {
- "config.h", "system.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", "libfuncs.h",
- "debug.h", "ggc.h",
+ "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",
+ "libfuncs.h", "debug.h", "ggc.h",
NULL
};
const char *const *ifp;
@@ -1137,7 +1139,6 @@ static const char *
get_file_basename (f)
const char *f;
{
- size_t len;
const char *basename;
unsigned i;
@@ -1146,7 +1147,6 @@ get_file_basename (f)
if (!basename)
return f;
- len = strlen (f);
basename++;
for (i = 1; i < NUM_BASE_FILES; i++)
diff --git a/gcc/genopinit.c b/gcc/genopinit.c
index ef4242a64cd..01bfdd4e7b8 100644
--- a/gcc/genopinit.c
+++ b/gcc/genopinit.c
@@ -20,8 +20,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "errors.h"
#include "gensupport.h"
@@ -112,6 +114,11 @@ static const char * const optabs[] =
abs_optab->handlers[(int) $A].insn_code = CODE_FOR_$(abs$F$a2$)",
"absv_optab->handlers[(int) $A].insn_code = CODE_FOR_$(absv$I$a2$)",
"sqrt_optab->handlers[$A].insn_code = CODE_FOR_$(sqrt$a2$)",
+ "floor_optab->handlers[$A].insn_code = CODE_FOR_$(floor$a2$)",
+ "ceil_optab->handlers[$A].insn_code = CODE_FOR_$(ceil$a2$)",
+ "round_optab->handlers[$A].insn_code = CODE_FOR_$(round$a2$)",
+ "trunc_optab->handlers[$A].insn_code = CODE_FOR_$(trunc$a2$)",
+ "nearbyint_optab->handlers[$A].insn_code = CODE_FOR_$(nearbyint$a2$)",
"sin_optab->handlers[$A].insn_code = CODE_FOR_$(sin$a2$)",
"cos_optab->handlers[$A].insn_code = CODE_FOR_$(cos$a2$)",
"exp_optab->handlers[$A].insn_code = CODE_FOR_$(exp$a2$)",
@@ -329,6 +336,8 @@ from the machine description file `md'. */\n\n");
printf ("#include \"config.h\"\n");
printf ("#include \"system.h\"\n");
+ printf ("#include \"coretypes.h\"\n");
+ printf ("#include \"tm.h\"\n");
printf ("#include \"rtl.h\"\n");
printf ("#include \"flags.h\"\n");
printf ("#include \"insn-config.h\"\n");
diff --git a/gcc/genoutput.c b/gcc/genoutput.c
index 80b73fcb915..662a6b0465b 100644
--- a/gcc/genoutput.c
+++ b/gcc/genoutput.c
@@ -85,8 +85,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
insn_data[24].template to be "clrd %0", and
insn_data[24].n_operands to be 1. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "errors.h"
#include "gensupport.h"
@@ -219,6 +221,8 @@ output_prologue ()
printf ("#include \"config.h\"\n");
printf ("#include \"system.h\"\n");
+ printf ("#include \"coretypes.h\"\n");
+ printf ("#include \"tm.h\"\n");
printf ("#include \"flags.h\"\n");
printf ("#include \"ggc.h\"\n");
printf ("#include \"rtl.h\"\n");
@@ -235,6 +239,7 @@ output_prologue ()
printf ("#include \"recog.h\"\n\n");
printf ("#include \"toplev.h\"\n");
printf ("#include \"output.h\"\n");
+ printf ("#include \"target.h\"\n");
}
diff --git a/gcc/genpeep.c b/gcc/genpeep.c
index 036f68812d1..f5fd84e1aab 100644
--- a/gcc/genpeep.c
+++ b/gcc/genpeep.c
@@ -20,8 +20,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "errors.h"
#include "gensupport.h"
@@ -393,6 +395,8 @@ from the machine description file `md'. */\n\n");
printf ("#include \"config.h\"\n");
printf ("#include \"system.h\"\n");
+ printf ("#include \"coretypes.h\"\n");
+ printf ("#include \"tm.h\"\n");
printf ("#include \"insn-config.h\"\n");
printf ("#include \"rtl.h\"\n");
printf ("#include \"tm_p.h\"\n");
diff --git a/gcc/genpreds.c b/gcc/genpreds.c
index cf8c0bd46ba..f008526b3b0 100644
--- a/gcc/genpreds.c
+++ b/gcc/genpreds.c
@@ -21,8 +21,10 @@ 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 "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#define NO_GENRTL_H
#include "rtl.h"
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index 56b2680eb1f..ec74539808c 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -50,8 +50,10 @@
the new rtl is returned in an INSN list, and LAST_INSN will point
to the last recognized insn in the old sequence. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "errors.h"
#include "gensupport.h"
@@ -2396,6 +2398,8 @@ write_header ()
\n\
#include \"config.h\"\n\
#include \"system.h\"\n\
+#include \"coretypes.h\"\n\
+#include \"tm.h\"\n\
#include \"rtl.h\"\n\
#include \"tm_p.h\"\n\
#include \"function.h\"\n\
diff --git a/gcc/gensupport.c b/gcc/gensupport.c
index 53172dd55b4..bc07c90317c 100644
--- a/gcc/gensupport.c
+++ b/gcc/gensupport.c
@@ -18,8 +18,10 @@
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "obstack.h"
#include "errors.h"
diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c
index b0ebabc40ce..f353617f4f7 100644
--- a/gcc/ggc-common.c
+++ b/gcc/ggc-common.c
@@ -23,6 +23,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "tm_p.h"
diff --git a/gcc/ggc-none.c b/gcc/ggc-none.c
index 3711475dc0b..ceb1f4498f1 100644
--- a/gcc/ggc-none.c
+++ b/gcc/ggc-none.c
@@ -24,6 +24,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "ggc.h"
void *
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index f210af93abe..537f302578a 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -20,6 +20,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "tm_p.h"
diff --git a/gcc/ggc-simple.c b/gcc/ggc-simple.c
index 30b8725c005..554ef722669 100644
--- a/gcc/ggc-simple.c
+++ b/gcc/ggc-simple.c
@@ -20,6 +20,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "tm_p.h"
diff --git a/gcc/global.c b/gcc/global.c
index 471e42e8fd9..3b2334fcbf6 100644
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -22,6 +22,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "machmode.h"
#include "hard-reg-set.h"
@@ -1363,15 +1365,9 @@ record_conflicts (allocno_vec, len)
int *allocno_vec;
int len;
{
- int num;
- int ialloc_prod;
-
while (--len >= 0)
- {
- num = allocno_vec[len];
- ialloc_prod = num * allocno_row_words;
- IOR_HARD_REG_SET (allocno[num].hard_reg_conflicts, hard_regs_live);
- }
+ IOR_HARD_REG_SET (allocno[allocno_vec[len]].hard_reg_conflicts,
+ hard_regs_live);
}
/* If CONFLICTP (i, j) is true, make sure CONFLICTP (j, i) is also true. */
diff --git a/gcc/graph.c b/gcc/graph.c
index 572c6b26e24..e56ef93809f 100644
--- a/gcc/graph.c
+++ b/gcc/graph.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include <config.h>
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "flags.h"
diff --git a/gcc/gthr-dce.h b/gcc/gthr-dce.h
index 622e465a795..563754ea440 100644
--- a/gcc/gthr-dce.h
+++ b/gcc/gthr-dce.h
@@ -425,13 +425,6 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
}
static inline int
-__gthread_key_dtor (UNUSED (__gthread_key_t key), UNUSED (void *ptr))
-{
- /* Nothing needed. */
- return 0;
-}
-
-static inline int
__gthread_key_delete (UNUSED (__gthread_key_t key))
{
/* Operation is not supported. */
diff --git a/gcc/gthr-posix.h b/gcc/gthr-posix.h
index 9149e645ceb..02f70aa9b32 100644
--- a/gcc/gthr-posix.h
+++ b/gcc/gthr-posix.h
@@ -462,16 +462,6 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
}
static inline int
-__gthread_key_dtor (__gthread_key_t key, void *ptr)
-{
- /* Just reset the key value to zero. */
- if (ptr)
- return pthread_setspecific (key, 0);
- else
- return 0;
-}
-
-static inline int
__gthread_key_delete (__gthread_key_t key)
{
return pthread_key_delete (key);
diff --git a/gcc/gthr-rtems.h b/gcc/gthr-rtems.h
index 23e35d7403f..8d0eb48634b 100644
--- a/gcc/gthr-rtems.h
+++ b/gcc/gthr-rtems.h
@@ -53,7 +53,6 @@ typedef void *__gthread_mutex_t;
/* generic per task variables */
extern int rtems_gxx_once (__gthread_once_t *once, void (*func) (void));
extern int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *));
-extern int rtems_gxx_key_dtor (__gthread_key_t key, void *ptr);
extern int rtems_gxx_key_delete (__gthread_key_t key);
extern void *rtems_gxx_getspecific (__gthread_key_t key);
extern int rtems_gxx_setspecific (__gthread_key_t key, const void *ptr);
@@ -86,12 +85,6 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
}
static inline int
-__gthread_key_dtor (__gthread_key_t key, void *ptr)
-{
- return rtems_gxx_key_dtor(key, ptr);
-}
-
-static inline int
__gthread_key_delete (__gthread_key_t key)
{
return rtems_gxx_key_delete (key);
diff --git a/gcc/gthr-solaris.h b/gcc/gthr-solaris.h
index 726223dbb7d..33ddf7a363c 100644
--- a/gcc/gthr-solaris.h
+++ b/gcc/gthr-solaris.h
@@ -417,13 +417,6 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
}
static inline int
-__gthread_key_dtor (__gthread_key_t key, void *ptr)
-{
- /* Nothing needed. */
- return 0;
-}
-
-static inline int
__gthread_key_delete (__gthread_key_t key)
{
/* Not possible. */
diff --git a/gcc/gthr-vxworks.h b/gcc/gthr-vxworks.h
index c85b5e535f3..4fb3b09404a 100644
--- a/gcc/gthr-vxworks.h
+++ b/gcc/gthr-vxworks.h
@@ -32,279 +32,72 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifdef _LIBOBJC
-/* Thread local storage for a single thread */
-static void *thread_local_storage = NULL;
+/* libobjc requires the optional pthreads component. */
+#include "gthr-posix.h"
-/* Backend initialization functions */
-
-/* Initialize the threads subsystem. */
-int
-__gthread_objc_init_thread_system (void)
-{
- /* No thread support available */
- return -1;
-}
-
-/* Close the threads subsystem. */
-int
-__gthread_objc_close_thread_system (void)
-{
- /* No thread support available */
- return -1;
-}
-
-/* Backend thread functions */
-
-/* Create a new thread of execution. */
-objc_thread_t
-__gthread_objc_thread_detach (void (*func)(void *arg), void *arg)
-{
- /* No thread support available */
- return NULL;
-}
-
-/* Set the current thread's priority. */
-int
-__gthread_objc_thread_set_priority (int priority)
-{
- /* No thread support available */
- return -1;
-}
-
-/* Return the current thread's priority. */
-int
-__gthread_objc_thread_get_priority (void)
-{
- return OBJC_THREAD_INTERACTIVE_PRIORITY;
-}
-
-/* Yield our process time to another thread. */
-void
-__gthread_objc_thread_yield (void)
-{
- return;
-}
-
-/* Terminate the current thread. */
-int
-__gthread_objc_thread_exit (void)
-{
- /* No thread support available */
- /* Should we really exit the program */
- /* exit (&__objc_thread_exit_status); */
- return -1;
-}
-
-/* Returns an integer value which uniquely describes a thread. */
-objc_thread_t
-__gthread_objc_thread_id (void)
-{
- /* No thread support, use 1. */
- return (objc_thread_t) 1;
-}
-
-/* Sets the thread's local storage pointer. */
-int
-__gthread_objc_thread_set_data (void *value)
-{
- thread_local_storage = value;
- return 0;
-}
-
-/* Returns the thread's local storage pointer. */
-void *
-__gthread_objc_thread_get_data (void)
-{
- return thread_local_storage;
-}
-
-/* Backend mutex functions */
-
-/* Allocate a mutex. */
-int
-__gthread_objc_mutex_allocate (objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Deallocate a mutex. */
-int
-__gthread_objc_mutex_deallocate (objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Grab a lock on a mutex. */
-int
-__gthread_objc_mutex_lock (objc_mutex_t mutex)
-{
- /* There can only be one thread, so we always get the lock */
- return 0;
-}
-
-/* Try to grab a lock on a mutex. */
-int
-__gthread_objc_mutex_trylock (objc_mutex_t mutex)
-{
- /* There can only be one thread, so we always get the lock */
- return 0;
-}
-
-/* Unlock the mutex */
-int
-__gthread_objc_mutex_unlock (objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Backend condition mutex functions */
-
-/* Allocate a condition. */
-int
-__gthread_objc_condition_allocate (objc_condition_t condition)
-{
- return 0;
-}
-
-/* Deallocate a condition. */
-int
-__gthread_objc_condition_deallocate (objc_condition_t condition)
-{
- return 0;
-}
-
-/* Wait on the condition */
-int
-__gthread_objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex)
-{
- return 0;
-}
-
-/* Wake up all threads waiting on this condition. */
-int
-__gthread_objc_condition_broadcast (objc_condition_t condition)
-{
- return 0;
-}
-
-/* Wake up one thread waiting on this condition. */
-int
-__gthread_objc_condition_signal (objc_condition_t condition)
-{
- return 0;
-}
-
-#else /* _LIBOBJC */
-
-/* POSIX threads specific definitions.
- Easy, since the interface is just one-to-one mapping. */
+#else
#define __GTHREADS 1
+#define __gthread_active_p() 1
+
+/* Mutexes are easy, except that they need to be initialized at runtime. */
-#include <vxWorks.h>
#include <semLib.h>
-/* typedef void *SEM_ID; */
-typedef int __gthread_key_t;
-typedef char __gthread_once_t;
typedef SEM_ID __gthread_mutex_t;
+#define __GTHREAD_MUTEX_INIT_FUNCTION __gthread_mutex_init_function
-#define __GTHREAD_MUTEX_INIT 0
-#define __GTHREAD_ONCE_INIT 0
-
-#ifndef REG_SAVED_REG
-static inline int
-__gthread_once (__gthread_once_t *once, void (*func) (void))
-{
- (*func)();
- return 0;
-}
-
-extern __gthread_key_t eh_context_key;
-
-/* This is not the right way to do it, but the semantic of pthreads
- don't map well enough onto VxWorks. */
-
-static void
-__ehdtor (void *pTcb)
-{
- int tid = (int) pTcb;
- void *p = (void *) taskVarGet (tid, &eh_context_key);
- if (p != (void *) -1)
- {
- if (p)
- free (p);
- taskVarSet (tid, &eh_context_key, 0);
- }
-}
-
-/* This only works for the code in libgcc2.c. */
-
-static inline int
-__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
+static inline void
+__gthread_mutex_init_function (__gthread_mutex_t *mutex)
{
- *key = 0;
-
- /* Do this first so that the task variables are visible during the
- running of the delete hook. */
-
- taskVarInit ();
-
- /* We don't have a way to track dtor here, so instead, we
- register a generic routine that can cleanup any task. */
-
- taskDeleteHookAdd (__ehdtor);
-
- return 0;
+ *mutex = semMCreate (SEM_Q_PRIORITY | SEM_INVERSION_SAFE | SEM_DELETE_SAFE);
}
-#define __gthread_setspecific(key, ptr) \
- (key = (int) ptr, 0)
-
-static inline int
-__gthread_key_dtor (__gthread_key_t key, void *ptr)
-{
- /* Just reset the key value to zero. */
- if (ptr)
- return __gthread_setspecific (key, 0);
- else
- return 0;
-}
-
-#define __gthread_key_delete(key) \
- taskVarDelete (taskIdSelf (), &key)
-
-#define __gthread_getspecific(key) \
- ((key == 0) \
- ? ((taskVarAdd (taskIdSelf (), &key) != OK) \
- ? (__terminate (), (void *) 0) \
- : (void *) 0) \
- : (void *) key)
-#endif
-
static inline int
__gthread_mutex_lock (__gthread_mutex_t *mutex)
{
- if (*mutex == 0)
- *mutex = semMCreate (SEM_Q_PRIORITY | SEM_INVERSION_SAFE | SEM_DELETE_SAFE);
return semTake (*mutex, WAIT_FOREVER);
}
static inline int
__gthread_mutex_trylock (__gthread_mutex_t *mutex)
{
- if (*mutex == 0)
- *mutex = semMCreate (SEM_Q_PRIORITY | SEM_INVERSION_SAFE | SEM_DELETE_SAFE);
return semTake (*mutex, NO_WAIT);
}
static inline int
__gthread_mutex_unlock (__gthread_mutex_t *mutex)
{
- /* We could return the */
return semGive (*mutex);
}
-#endif /* _LIBOBJC */
+/* pthread_once is complicated enough that it's implemented
+ out-of-line. See config/vxlib.c. */
+
+typedef struct
+{
+ volatile unsigned char busy;
+ volatile unsigned char done;
+}
+__gthread_once_t;
+
+#define __GTHREAD_ONCE_INIT { 0, 0 }
+
+extern int __gthread_once (__gthread_once_t *once, void (*func)(void));
+
+/* Thread-specific data requires a great deal of effort, since VxWorks
+ is not really set up for it. See config/vxlib.c for the gory
+ details. All the TSD routines are sufficiently complex that they
+ need to be implemented out of line. */
+
+typedef unsigned int __gthread_key_t;
+
+extern int __gthread_key_create (__gthread_key_t *keyp, void (*dtor)(void *));
+extern int __gthread_key_delete (__gthread_key_t key);
+
+extern void *__gthread_getspecific (__gthread_key_t key);
+extern int __gthread_setspecific (__gthread_key_t key, void *ptr);
+
+#endif /* not _LIBOBJC */
-#endif /* ! GCC_GTHR_VXWORKS_H */
+#endif /* gthr-vxworks.h */
diff --git a/gcc/gthr-win32.h b/gcc/gthr-win32.h
index 38b8f04a12a..fe8743a8658 100644
--- a/gcc/gthr-win32.h
+++ b/gcc/gthr-win32.h
@@ -397,13 +397,6 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
}
static inline int
-__gthread_key_dtor (__gthread_key_t key, void *ptr)
-{
- /* Nothing needed. */
- return 0;
-}
-
-static inline int
__gthread_key_delete (__gthread_key_t key)
{
return __gthr_win32_key_delete (key);
@@ -511,15 +504,6 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
return status;
}
-/* Currently, this routine is called only for Mingw runtime, and if
- -mthreads option is chosen to link in the thread support DLL. */
-static inline int
-__gthread_key_dtor (__gthread_key_t key, void *ptr)
-{
- /* Nothing needed. */
- return 0;
-}
-
static inline int
__gthread_key_delete (__gthread_key_t key)
{
diff --git a/gcc/gthr.h b/gcc/gthr.h
index b436bb6bb91..b0511543645 100644
--- a/gcc/gthr.h
+++ b/gcc/gthr.h
@@ -62,8 +62,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
int __gthread_key_create (__gthread_key_t *keyp, void (*dtor) (void *))
int __gthread_key_delete (__gthread_key_t key)
- int __gthread_key_dtor (__gthread_key_t key, void *ptr)
-
void *__gthread_getspecific (__gthread_key_t key)
int __gthread_setspecific (__gthread_key_t key, const void *ptr)
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index c253f2cede1..5a0c208b219 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -134,6 +134,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "toplev.h"
#include "rtl.h"
#include "tm_p.h"
@@ -857,7 +859,7 @@ rank_for_schedule (x, y)
/* Prefer an insn with smaller contribution to registers-pressure. */
if (!reload_completed &&
(weight_val = INSN_REG_WEIGHT (tmp) - INSN_REG_WEIGHT (tmp2)))
- return (weight_val);
+ return weight_val;
info_val = (*current_sched_info->rank) (tmp, tmp2);
if (info_val)
diff --git a/gcc/hashtable.c b/gcc/hashtable.c
index ff8959b40da..ae7e5899b9a 100644
--- a/gcc/hashtable.c
+++ b/gcc/hashtable.c
@@ -21,6 +21,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "hashtable.h"
/* The code below is a specialization of Vladimir Makarov's expandable
diff --git a/gcc/hashtable.h b/gcc/hashtable.h
index 02dfcf19d29..f6fe27a0bcc 100644
--- a/gcc/hashtable.h
+++ b/gcc/hashtable.h
@@ -25,8 +25,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
typedef struct ht_identifier ht_identifier;
struct ht_identifier GTY(())
{
- unsigned int len;
const unsigned char *str;
+ unsigned int len;
};
#define HT_LEN(NODE) ((NODE)->len)
diff --git a/gcc/hooks.c b/gcc/hooks.c
index 3f212ef3e1b..a80ead0c3e0 100644
--- a/gcc/hooks.c
+++ b/gcc/hooks.c
@@ -24,6 +24,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "hooks.h"
/* Generic hook that does absolutely zappo. */
@@ -116,6 +118,14 @@ hook_bool_tree_false (a)
}
bool
+hook_bool_tree_tree_false (a, b)
+ tree a ATTRIBUTE_UNUSED;
+ tree b ATTRIBUTE_UNUSED;
+{
+ return false;
+}
+
+bool
hook_bool_rtx_false (a)
rtx a ATTRIBUTE_UNUSED;
{
diff --git a/gcc/hooks.h b/gcc/hooks.h
index 8c28194f6ac..26f87dfe1a8 100644
--- a/gcc/hooks.h
+++ b/gcc/hooks.h
@@ -41,4 +41,6 @@ int hook_int_tree_tree_1 PARAMS ((tree, tree));
bool default_can_output_mi_thunk_no_vcall
PARAMS ((tree, HOST_WIDE_INT, HOST_WIDE_INT, tree));
+bool hook_bool_tree_tree_false PARAMS ((tree, tree));
+
#endif
diff --git a/gcc/hwint.h b/gcc/hwint.h
index 6d645a00ea7..b4de0e37082 100644
--- a/gcc/hwint.h
+++ b/gcc/hwint.h
@@ -15,152 +15,111 @@
#define HOST_BITS_PER_INT (CHAR_BIT * SIZEOF_INT)
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
+/* If HAVE_LONG_LONG and SIZEOF_LONG_LONG aren't defined, but
+ GCC_VERSION >= 3000, assume this is the second or later stage of a
+ bootstrap, we do have long long, and it's 64 bits. (This is
+ required by C99; we do have some ports that violate that assumption
+ but they're all cross-compile-only.) Just in case, force a
+ constraint violation if that assumption is incorrect. */
+#if !defined HAVE_LONG_LONG
+# if GCC_VERSION >= 3000
+# define HAVE_LONG_LONG 1
+# define SIZEOF_LONG_LONG 8
+extern char sizeof_long_long_must_be_8[sizeof(long long) == 8 ? 1 : -1];
+# endif
+#endif
+
#ifdef HAVE_LONG_LONG
# define HOST_BITS_PER_LONGLONG (CHAR_BIT * SIZEOF_LONG_LONG)
-#else
+#endif
#ifdef HAVE___INT64
-# define HOST_BITS_PER_LONGLONG (CHAR_BIT * SIZEOF___INT64)
-#else
-/* If we're here and we're GCC, assume this is stage 2+ of a bootstrap
- and 'long long' has the width of the *target*'s long long. */
-# if GCC_VERSION > 3000
-# define HOST_BITS_PER_LONGLONG LONG_LONG_TYPE_SIZE
-# endif /* gcc */
+# define HOST_BITS_PER___INT64 (CHAR_BIT * SIZEOF___INT64)
#endif
-#endif /* no long long */
-/* Find the largest host integer type and set its size and type. */
+/* Set HOST_WIDE_INT. This should be the widest efficient host
+ integer type. It can be 32 or 64 bits, except that if we are
+ targeting a machine with 64-bit size_t then it has to be 64 bits.
-/* Use long long on the host if the target has a wider long type than
- the host. */
+ With a sane ABI, 'long' is the largest efficient host integer type.
+ Thus, we use that unless we have to use 'long long' or '__int64'
+ because we're targeting a 64-bit machine from a 32-bit host. */
-#if ! defined HOST_BITS_PER_WIDE_INT \
- && defined HOST_BITS_PER_LONGLONG \
- && (HOST_BITS_PER_LONGLONG > HOST_BITS_PER_LONG) \
- && (defined (LONG_LONG_MAX) || defined (LONGLONG_MAX) \
- || defined (LLONG_MAX) || defined (__GNUC__))
-
-# ifdef MAX_LONG_TYPE_SIZE
-# if MAX_LONG_TYPE_SIZE > HOST_BITS_PER_LONG
-# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONGLONG
-# define HOST_WIDE_INT long long
-# endif
-# else
-# if LONG_TYPE_SIZE > HOST_BITS_PER_LONG
+#if HOST_BITS_PER_LONG >= 64 || !defined NEED_64BIT_HOST_WIDE_INT
+# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
+# define HOST_WIDE_INT long
+#else
+# if HOST_BITS_PER_LONGLONG >= 64
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONGLONG
# define HOST_WIDE_INT long long
-# endif
-# endif
-
-#endif
-
-#ifndef HOST_BITS_PER_WIDE_INT
-
-# if HOST_BITS_PER_LONG > HOST_BITS_PER_INT
-# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
-# define HOST_WIDE_INT long
-# else
-# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_INT
-# define HOST_WIDE_INT int
-# endif
-
-#endif /* ! HOST_BITS_PER_WIDE_INT */
-
-/* Provide defaults for the way to print a HOST_WIDE_INT
- in various manners. */
-
-#ifndef HOST_WIDE_INT_PRINT_DEC
-# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
-# define HOST_WIDE_INT_PRINT_DEC "%d"
-# define HOST_WIDE_INT_PRINT_DEC_C "%d"
-# define HOST_WIDE_INT_PRINT_DEC_SPACE "% *d"
# else
-# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
-# define HOST_WIDE_INT_PRINT_DEC "%ld"
-# define HOST_WIDE_INT_PRINT_DEC_C "%ldL"
-# define HOST_WIDE_INT_PRINT_DEC_SPACE "% *ld"
+# if HOST_BITS_PER___INT64 >= 64
+# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER___INT64
+# define HOST_WIDE_INT __int64
# else
-# define HOST_WIDE_INT_PRINT_DEC "%lld"
-# define HOST_WIDE_INT_PRINT_DEC_C "%lldLL"
-# define HOST_WIDE_INT_PRINT_DEC_SPACE "% *lld"
+ #error "Unable to find a suitable type for HOST_WIDE_INT"
# endif
# endif
-#endif /* ! HOST_WIDE_INT_PRINT_DEC */
-
-#ifndef HOST_WIDE_INT_PRINT_UNSIGNED
-# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
-# define HOST_WIDE_INT_PRINT_UNSIGNED "%u"
-# define HOST_WIDE_INT_PRINT_UNSIGNED_SPACE "% *u"
-# else
-# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
-# define HOST_WIDE_INT_PRINT_UNSIGNED "%lu"
-# define HOST_WIDE_INT_PRINT_UNSIGNED_SPACE "% *lu"
-# else
-# define HOST_WIDE_INT_PRINT_UNSIGNED "%llu"
-# define HOST_WIDE_INT_PRINT_UNSIGNED_SPACE "% *llu"
-# endif
-# endif
-#endif /* ! HOST_WIDE_INT_PRINT_UNSIGNED */
+#endif
-#ifndef HOST_WIDE_INT_PRINT_HEX
-# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
-# define HOST_WIDE_INT_PRINT_HEX "0x%x"
+/* Various printf format strings for HOST_WIDE_INT. */
+
+#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
+# define HOST_WIDE_INT_PRINT_DEC "%ld"
+# define HOST_WIDE_INT_PRINT_DEC_C "%ldL"
+# define HOST_WIDE_INT_PRINT_DEC_SPACE "% *ld"
+# define HOST_WIDE_INT_PRINT_UNSIGNED "%lu"
+# define HOST_WIDE_INT_PRINT_UNSIGNED_SPACE "% *lu"
+# define HOST_WIDE_INT_PRINT_HEX "0x%lx"
+ /* 'long' might be 32 or 64 bits, and the number of leading zeroes
+ must be tweaked accordingly. */
+# if HOST_BITS_PER_WIDE_INT == 64
+# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%016lx"
# else
-# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
-# define HOST_WIDE_INT_PRINT_HEX "0x%lx"
-# else
-# define HOST_WIDE_INT_PRINT_HEX "0x%llx"
-# endif
+# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%08lx"
# endif
-#endif /* ! HOST_WIDE_INT_PRINT_HEX */
+#else
+# define HOST_WIDE_INT_PRINT_DEC "%lld"
+# define HOST_WIDE_INT_PRINT_DEC_C "%lldLL"
+# define HOST_WIDE_INT_PRINT_DEC_SPACE "% *lld"
+# define HOST_WIDE_INT_PRINT_UNSIGNED "%llu"
+# define HOST_WIDE_INT_PRINT_UNSIGNED_SPACE "% *llu"
+# define HOST_WIDE_INT_PRINT_HEX "0x%llx"
+ /* We can assume that 'long long' is at least 64 bits. */
+# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%llx%016llx"
+#endif
-#ifndef HOST_WIDE_INT_PRINT_DOUBLE_HEX
-# if HOST_BITS_PER_WIDE_INT == 64
-# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
-# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%x%016x"
-# else
-# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
-# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%016lx"
-# else
-# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%llx%016llx"
-# endif
-# endif
+/* Set HOST_WIDEST_INT. Unlike HOST_WIDE_INT, this must always be
+ at least 64 bits wide. */
+
+#if HOST_BITS_PER_WIDE_INT >= 64
+# define HOST_WIDEST_INT HOST_WIDE_INT
+# define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_WIDE_INT
+# define HOST_WIDEST_INT_PRINT_DEC HOST_WIDE_INT_PRINT_DEC
+# define HOST_WIDEST_INT_PRINT_DEC_C HOST_WIDE_INT_PRINT_DEC_C
+# define HOST_WIDEST_INT_PRINT_DEC_SPACE HOST_WIDE_INT_PRINT_DEC_SPACE
+# define HOST_WIDEST_INT_PRINT_UNSIGNED HOST_WIDE_INT_PRINT_UNSIGNED
+# define HOST_WIDEST_INT_PRINT_UNSIGNED_SPACE HOST_WIDE_INT_PRINT_UNSIGNED_SPACE
+# define HOST_WIDEST_INT_PRINT_HEX HOST_WIDE_INT_PRINT_HEX
+# define HOST_WIDEST_INT_PRINT_DOUBLE_HEX HOST_WIDE_INT_PRINT_DOUBLE_HEX
+#else
+# if HOST_BITS_PER_LONGLONG >= 64
+# define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_LONGLONG
+# define HOST_WIDEST_INT long long
# else
-# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
-# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%x%08x"
+# if HOST_BITS_PER___INT64 >= 64
+# define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER___INT64
+# define HOST_WIDEST_INT __int64
# else
-# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
-# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%08lx"
-# else
-# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%llx%08llx"
-# endif
+ #error "Unable to find a suitable type for HOST_WIDEST_INT"
# endif
# endif
-#endif /* ! HOST_WIDE_INT_PRINT_DOUBLE_HEX */
-
-/* Find HOST_WIDEST_INT and set its bit size, type and print macros.
- It will be the largest integer mode supported by the host which may
- (or may not) be larger than HOST_WIDE_INT. */
-
-#ifndef HOST_WIDEST_INT
-#if defined HOST_BITS_PER_LONGLONG \
- && HOST_BITS_PER_LONGLONG > HOST_BITS_PER_LONG
-# define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_LONGLONG
-# define HOST_WIDEST_INT long long
-# define HOST_WIDEST_INT_PRINT_DEC "%lld"
-# define HOST_WIDEST_INT_PRINT_DEC_SPACE "% *lld"
-# define HOST_WIDEST_INT_PRINT_UNSIGNED "%llu"
-# define HOST_WIDEST_INT_PRINT_UNSIGNED_SPACE "% *llu"
-# define HOST_WIDEST_INT_PRINT_HEX "0x%llx"
-# else
-# define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_LONG
-# define HOST_WIDEST_INT long
-# define HOST_WIDEST_INT_PRINT_DEC "%ld"
-# define HOST_WIDEST_INT_PRINT_DEC_SPACE "% *ld"
-# define HOST_WIDEST_INT_PRINT_UNSIGNED "%lu"
-# define HOST_WIDEST_INT_PRINT_UNSIGNED_SPACE "% *lu"
-# define HOST_WIDEST_INT_PRINT_HEX "0x%lx"
-# endif /* long long wider than long */
-#endif /* ! HOST_WIDEST_INT */
+# define HOST_WIDEST_INT_PRINT_DEC "%lld"
+# define HOST_WIDEST_INT_PRINT_DEC_C "%lldLL"
+# define HOST_WIDEST_INT_PRINT_DEC_SPACE "% *lld"
+# define HOST_WIDEST_INT_PRINT_UNSIGNED "%llu"
+# define HOST_WIDEST_INT_PRINT_UNSIGNED_SPACE "% *llu"
+# define HOST_WIDEST_INT_PRINT_HEX "0x%llx"
+# define HOST_WIDEST_INT_PRINT_DOUBLE_HEX "0x%llx%016llx"
+#endif
#endif /* ! GCC_HWINT_H */
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 42c5fb50bdb..0652afd99ee 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -20,6 +20,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
diff --git a/gcc/integrate.c b/gcc/integrate.c
index 6746b3f450f..355cac345eb 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -22,6 +22,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
diff --git a/gcc/intl.c b/gcc/intl.c
index 87dad513539..958e77af377 100644
--- a/gcc/intl.c
+++ b/gcc/intl.c
@@ -20,6 +20,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "intl.h"
#ifdef ENABLE_NLS
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index c6d0de1c1e3..334bfda5fb4 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -15,6 +15,16 @@
* parse.y (do_resolve_class): Handle qualified name via
recursion.
+2002-11-30 Zack Weinberg <zack@codesourcery.com>
+
+ * boehm.c, buffer.c, builtins.c, check-init.c, class.c,
+ constants.c, decl.c, except.c, expr.c, gjavah.c, jcf-depend.c,
+ jcf-dump.c, jcf-io.c, jcf-parse.c, jcf-path.c, jcf-write.c,
+ jv-scan.c, jvgenmain.c, jvspec.c, lang.c, mangle.c, mangle_name.c,
+ parse-scan.y, parse.y, typeck.c, verify.c, xref.c, zextract.c:
+ Include coretypes.h and tm.h.
+ * Make-lang.in: Update dependencies.
+
2002-11-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* decl.c (java_init_decl_processing): Use `LL' on 64-bit constant.
@@ -24,6 +34,11 @@
* jcf-reader.c: Don't expand JCF_readu4 inside the
expansion of JCF_SKIP.
+2002-11-25 Diego Novillo <dnovillo@redhat.com>
+
+ * jcf-reader.c: Don't expand JCF_readu4 inside the
+ expansion of JCF_SKIP.
+
2002-11-22 Tom Tromey <tromey@redhat.com>
* parse.y (patch_binop): Cast right hand side of shift expression
@@ -241,6 +256,10 @@
* lex.c (java_read_unicode_collapsing_terminators): Handle case
where \r appears at EOF. Fixes PR java/7950.
+2002-09-16 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * jvspec.c (lang_specific_driver): Remove unused variable.
+
2002-09-16 Geoffrey Keating <geoffk@apple.com>
* java-tree.h (union lang_tree_node): Add chain_next option.
diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in
index fc0e40b5161..efc58838915 100644
--- a/gcc/java/Make-lang.in
+++ b/gcc/java/Make-lang.in
@@ -61,7 +61,8 @@ JAVA_TARGET_INDEPENDENT_BIN_TOOLS = gcjh jv-scan jcf-dump
# Tell GNU make to ignore these if they exist.
.PHONY: java
-jvspec.o: $(srcdir)/java/jvspec.c $(SYSTEM_H) $(GCC_H) $(CONFIG_H)
+jvspec.o: $(srcdir)/java/jvspec.c $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(GCC_H) $(CONFIG_H)
(SHLIB_LINK='$(SHLIB_LINK)' \
SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \
@@ -261,74 +262,84 @@ JAVA_TREE_H = $(TREE_H) $(HASHTAB_H) java/java-tree.h java/java-tree.def
JAVA_LEX_C = java/lex.c java/keyword.h java/chartables.h
java/parse.o: java/parse.c java/jcf-reader.c $(CONFIG_H) $(SYSTEM_H) \
- function.h $(JAVA_TREE_H) $(JAVA_LEX_C) java/parse.h java/lex.h $(GGC_H) \
- debug.h gt-java-parse.h gtype-java.h
-java/jcf-dump.o: $(CONFIG_H) $(SYSTEM_H) $(JAVA_TREE_H) java/jcf-dump.c \
- java/jcf-reader.c java/jcf.h java/javaop.h java/javaop.def version.h
-java/gjavah.o: $(CONFIG_H) $(SYSTEM_H) $(JAVA_TREE_H) java/gjavah.c \
- java/jcf-reader.c java/jcf.h java/javaop.h version.h
-java/boehm.o: java/boehm.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(JAVA_TREE_H) \
- java/parse.h toplev.h
-java/buffer.o: java/buffer.c $(CONFIG_H) java/buffer.h $(SYSTEM_H) toplev.h
-java/builtins.o: java/builtins.c $(CONFIG_H) $(SYSTEM_H) $(JAVA_TREE_H) \
- $(GGC_H) flags.h builtin-types.def langhooks.h gt-java-builtins.h
-java/check-init.o: java/check-init.c $(CONFIG_H) \
- $(JAVA_TREE_H) $(SYSTEM_H) toplev.h
-java/class.o: java/class.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) java/jcf.h \
- java/parse.h toplev.h $(SYSTEM_H) output.h $(GGC_H) $(TARGET_H) function.h \
- gt-java-class.h
+ coretypes.h $(TM_H) function.h $(JAVA_TREE_H) $(JAVA_LEX_C) java/parse.h \
+ java/lex.h $(GGC_H) debug.h gt-java-parse.h gtype-java.h
+java/jcf-dump.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(JAVA_TREE_H) \
+ java/jcf-dump.c java/jcf-reader.c java/jcf.h java/javaop.h java/javaop.def \
+ version.h
+java/gjavah.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(JAVA_TREE_H) \
+ java/gjavah.c java/jcf-reader.c java/jcf.h java/javaop.h version.h
+java/boehm.o: java/boehm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(TREE_H) $(JAVA_TREE_H) java/parse.h toplev.h
+java/buffer.o: java/buffer.c $(CONFIG_H) java/buffer.h $(SYSTEM_H) coretypes.h \
+ $(TM_H) toplev.h
+java/builtins.o: java/builtins.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(JAVA_TREE_H) $(GGC_H) flags.h builtin-types.def langhooks.h \
+ gt-java-builtins.h
+java/check-init.o: java/check-init.c $(CONFIG_H) $(JAVA_TREE_H) $(SYSTEM_H) \
+ coretypes.h $(TM_H) toplev.h
+java/class.o: java/class.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(JAVA_TREE_H) $(RTL_H) java/jcf.h java/parse.h toplev.h output.h $(GGC_H) \
+ $(TARGET_H) function.h gt-java-class.h
java/constants.o: java/constants.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
- toplev.h $(SYSTEM_H) $(GGC_H) gt-java-constants.h
+ toplev.h $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) gt-java-constants.h
java/decl.o: java/decl.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) java/jcf.h \
- toplev.h flags.h $(SYSTEM_H) function.h expr.h libfuncs.h except.h \
- java/java-except.h $(GGC_H) real.h gt-java-decl.h
+ toplev.h flags.h $(SYSTEM_H) coretypes.h $(TM_H) function.h expr.h \
+ libfuncs.h except.h java/java-except.h $(GGC_H) real.h gt-java-decl.h
java/except.o: java/except.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h real.h \
$(RTL_H) java/javaop.h java/java-opcodes.h except.h java/java-except.h \
- toplev.h $(SYSTEM_H) function.h
+ toplev.h $(SYSTEM_H) coretypes.h $(TM_H) function.h
java/expr.o: java/expr.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h real.h \
$(RTL_H) $(EXPR_H) java/javaop.h java/java-opcodes.h except.h \
java/java-except.h java/java-except.h java/parse.h toplev.h \
- $(SYSTEM_H) $(GGC_H) gt-java-expr.h
-java/java-tree-inline.o: tree-inline.c $(CONFIG_H) $(SYSTEM_H) \
- $(TREE_H) $(RTL_H) expr.h flags.h params.h input.h insn-config.h \
+ $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) gt-java-expr.h
+java/java-tree-inline.o: tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(TREE_H) $(RTL_H) expr.h flags.h params.h input.h insn-config.h \
$(INTEGRATE_H) $(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) toplev.h \
langhooks.h $(C_COMMON_H) $(srcdir)/tree-inline.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DINLINER_FOR_JAVA=1 \
$(srcdir)/tree-inline.c -o $@
-java/jcf-depend.o: java/jcf-depend.c $(CONFIG_H) $(SYSTEM_H) java/jcf.h
+java/jcf-depend.o: java/jcf-depend.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) java/jcf.h
java/jcf-parse.o: java/jcf-parse.c $(CONFIG_H) $(JAVA_TREE_H) flags.h \
- input.h java/java-except.h $(SYSTEM_H) toplev.h java/parse.h $(GGC_H) \
- debug.h real.h gt-java-jcf-parse.h
+ input.h java/java-except.h $(SYSTEM_H) coretypes.h $(TM_H) toplev.h \
+ java/parse.h $(GGC_H) debug.h real.h gt-java-jcf-parse.h
java/jcf-write.o: java/jcf-write.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
$(RTL_H) java/java-opcodes.h java/parse.h java/buffer.h $(SYSTEM_H) \
- toplev.h $(GGC_H) gt-java-jcf-write.h
-java/jv-scan.o: java/jv-scan.c $(CONFIG_H) $(SYSTEM_H) version.h
-java/jvgenmain.o: java/jvgenmain.c $(CONFIG_H) $(JAVA_TREE_H) $(SYSTEM_H)
+ coretypes.h $(TM_H) toplev.h $(GGC_H) gt-java-jcf-write.h
+java/jv-scan.o: java/jv-scan.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ version.h
+java/jvgenmain.o: java/jvgenmain.c $(CONFIG_H) $(JAVA_TREE_H) $(SYSTEM_H) \
+ coretypes.h $(TM_H)
java/lang.o: java/lang.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h input.h \
- toplev.h $(SYSTEM_H) $(RTL_H) $(EXPR_H) diagnostic.h langhooks.h \
- $(LANGHOOKS_DEF_H) gt-java-lang.h
+ toplev.h $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(EXPR_H) diagnostic.h \
+ langhooks.h $(LANGHOOKS_DEF_H) gt-java-lang.h
java/mangle.o: java/mangle.c $(CONFIG_H) java/jcf.h $(JAVA_TREE_H) $(SYSTEM_H) \
- toplev.h $(GGC_H) gt-java-mangle.h
+ coretypes.h $(TM_H) toplev.h $(GGC_H) gt-java-mangle.h
java/mangle_name.o: java/mangle_name.c $(CONFIG_H) java/jcf.h $(JAVA_TREE_H) \
- $(SYSTEM_H) toplev.h $(GGC_H)
-java/parse-scan.o: $(CONFIG_H) $(SYSTEM_H) toplev.h $(JAVA_LEX_C) java/parse.h \
- java/lex.h
+ $(SYSTEM_H) coretypes.h $(TM_H) toplev.h $(GGC_H)
+java/parse-scan.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h \
+ $(JAVA_LEX_C) java/parse.h java/lex.h
java/typeck.o: java/typeck.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
- java/convert.h toplev.h $(SYSTEM_H) $(GGC_H) real.h
+ java/convert.h toplev.h $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) real.h
java/verify.o: java/verify.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
- java/javaop.h java/java-opcodes.h java/java-except.h toplev.h $(SYSTEM_H)
+ java/javaop.h java/java-opcodes.h java/java-except.h toplev.h $(SYSTEM_H) \
+ coretypes.h $(TM_H)
java/xref.o: java/xref.c java/xref.h $(CONFIG_H) $(JAVA_TREE_H) toplev.h \
- $(SYSTEM_H)
-java/zextract.o: java/zextract.c $(CONFIG_H) $(SYSTEM_H) java/zipfile.h
+ $(SYSTEM_H) coretypes.h $(TM_H)
+java/zextract.o: java/zextract.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ java/zipfile.h
# jcf-io.o needs $(ZLIBINC) added to cflags.
-java/jcf-io.o: java/jcf-io.c $(CONFIG_H) $(SYSTEM_H) $(JAVA_TREE_H)
+java/jcf-io.o: java/jcf-io.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(JAVA_TREE_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ZLIBINC) \
$(srcdir)/java/jcf-io.c $(OUTPUT_OPTION)
# jcf-path.o needs a -D.
-java/jcf-path.o: java/jcf-path.c $(CONFIG_H) $(SYSTEM_H) java/jcf.h
+java/jcf-path.o: java/jcf-path.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ java/jcf.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DLIBGCJ_ZIP_FILE='"$(datadir)/java/libgcj-$(version).jar"' \
-DDEFAULT_TARGET_VERSION=\"$(version)\" \
diff --git a/gcc/java/boehm.c b/gcc/java/boehm.c
index 566655a6c96..d3956e7552c 100644
--- a/gcc/java/boehm.c
+++ b/gcc/java/boehm.c
@@ -27,6 +27,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include <config.h>
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "java-tree.h"
#include "parse.h"
diff --git a/gcc/java/buffer.c b/gcc/java/buffer.c
index 170cc04540a..01a97cb05ca 100644
--- a/gcc/java/buffer.c
+++ b/gcc/java/buffer.c
@@ -22,6 +22,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "buffer.h"
/* Grow BUFP so there is room for at least SIZE more bytes. */
diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c
index eba84161363..1c5301ef29d 100644
--- a/gcc/java/builtins.c
+++ b/gcc/java/builtins.c
@@ -27,6 +27,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "ggc.h"
#include "flags.h"
diff --git a/gcc/java/check-init.c b/gcc/java/check-init.c
index 6495a78d85a..118528468b2 100644
--- a/gcc/java/check-init.c
+++ b/gcc/java/check-init.c
@@ -24,6 +24,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "flags.h" /* Needed for optimize. */
#include "java-tree.h"
diff --git a/gcc/java/class.c b/gcc/java/class.c
index bec8d0c15e1..f833888367c 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -27,6 +27,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "flags.h"
diff --git a/gcc/java/constants.c b/gcc/java/constants.c
index 23f99572c92..977a7bdfece 100644
--- a/gcc/java/constants.c
+++ b/gcc/java/constants.c
@@ -23,6 +23,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "jcf.h"
#include "tree.h"
#include "java-tree.h"
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 41aea0c28f5..563bd7a8f65 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -28,6 +28,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "real.h"
diff --git a/gcc/java/except.c b/gcc/java/except.c
index 0de4c8af0b3..4e662b94c5b 100644
--- a/gcc/java/except.c
+++ b/gcc/java/except.c
@@ -24,6 +24,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "real.h"
#include "rtl.h"
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 8db2670d0f9..b2f956664ab 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -27,6 +27,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "real.h"
#include "rtl.h"
diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c
index 0c9d24990b7..9dc11abf310 100644
--- a/gcc/java/gjavah.c
+++ b/gcc/java/gjavah.c
@@ -26,6 +26,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include <math.h>
#include "jcf.h"
diff --git a/gcc/java/jcf-depend.c b/gcc/java/jcf-depend.c
index c9995609517..72ad1ed4171 100644
--- a/gcc/java/jcf-depend.c
+++ b/gcc/java/jcf-depend.c
@@ -25,6 +25,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "mkdeps.h"
#include <assert.h>
diff --git a/gcc/java/jcf-dump.c b/gcc/java/jcf-dump.c
index 72f1a5360b4..14b93d2daa0 100644
--- a/gcc/java/jcf-dump.c
+++ b/gcc/java/jcf-dump.c
@@ -48,6 +48,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "jcf.h"
#include "tree.h"
diff --git a/gcc/java/jcf-io.c b/gcc/java/jcf-io.c
index 7b0eacacc2f..e0138f4398c 100644
--- a/gcc/java/jcf-io.c
+++ b/gcc/java/jcf-io.c
@@ -24,6 +24,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "jcf.h"
#include "tree.h"
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index eeb262a4846..4d6b8b7092a 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -27,6 +27,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "real.h"
#include "obstack.h"
diff --git a/gcc/java/jcf-path.c b/gcc/java/jcf-path.c
index c9ed323dea4..8e266447843 100644
--- a/gcc/java/jcf-path.c
+++ b/gcc/java/jcf-path.c
@@ -25,6 +25,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include <dirent.h>
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index 47cfd11be8a..bfb1bd2724b 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -23,6 +23,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "jcf.h"
#include "tree.h"
#include "real.h"
diff --git a/gcc/java/jv-scan.c b/gcc/java/jv-scan.c
index f92acebd7f4..74ef53351f3 100644
--- a/gcc/java/jv-scan.c
+++ b/gcc/java/jv-scan.c
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "obstack.h" /* We use obstacks in lex.c */
diff --git a/gcc/java/jvgenmain.c b/gcc/java/jvgenmain.c
index 9a425715066..28b42f27a50 100644
--- a/gcc/java/jvgenmain.c
+++ b/gcc/java/jvgenmain.c
@@ -26,6 +26,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "obstack.h"
#include "jcf.h"
#include "tree.h"
diff --git a/gcc/java/jvspec.c b/gcc/java/jvspec.c
index c3efe58de3a..aee48c89415 100644
--- a/gcc/java/jvspec.c
+++ b/gcc/java/jvspec.c
@@ -25,6 +25,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "gcc.h"
/* Name of spec file. */
@@ -55,28 +57,28 @@ int lang_specific_extra_outfiles = 0;
int shared_libgcc = 1;
static const char jvgenmain_spec[] =
- "jvgenmain %{D*} %b %{!pipe:%u.i} |\n\
- cc1 %{!pipe:%U.i} %1 \
+ "jvgenmain %{D*} %b %m.i |\n\
+ cc1 %m.i %1 \
%{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\
%{g*} %{O*} \
%{v:-version} %{pg:-p} %{p}\
- %{<fbounds-check} %{<fno-bounds-check}\
- %{<fassume-compiled} %{<fno-assume-compiled}\
- %{<fcompile-resource*} %{<fassert} %{<fno-assert} \
- %{<femit-class-file} %{<femit-class-files} %{<fencoding*}\
- %{<fuse-boehm-gc} %{<fhash-synchronization} %{<fjni}\
- %{<findirect-dispatch} \
- %{<fno-store-check} %{<foutput-class-dir}\
- %{<fclasspath*} %{<fCLASSPATH*} %{<fbootclasspath*}\
- %{<fextdirs*}\
- %{<fuse-divide-subroutine} %{<fno-use-divide-subroutine}\
- %{<fcheck-references} %{<fno-check-references}\
- %{<ffilelist-file}\
+ %<fbounds-check %<fno-bounds-check\
+ %<fassume-compiled %<fno-assume-compiled\
+ %<fcompile-resource* %<fassert %<fno-assert \
+ %<femit-class-file %<femit-class-files %<fencoding*\
+ %<fuse-boehm-gc %<fhash-synchronization %<fjni\
+ %<findirect-dispatch \
+ %<fno-store-check %<foutput-class-dir\
+ %<fclasspath* %<fCLASSPATH* %<fbootclasspath*\
+ %<fextdirs*\
+ %<fuse-divide-subroutine %<fno-use-divide-subroutine\
+ %<fcheck-references %<fno-check-references\
+ %<ffilelist-file\
%{f*} -fdollars-in-identifiers\
%{aux-info*}\
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
- %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
- %{!S:as %a %Y -o %d%w%u%O %{!pipe:%g.s} %A\n }";
+ %{S:%W{o*}%{!o*:-o %b.s}}\
+ %(invoke_as)";
/* Return full path name of spec file if it is in DIR, or NULL if
not. */
@@ -161,9 +163,6 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
should be passed to a single jc1 invocation. */
int combine_inputs = 0;
- /* Index of last .java or .class argument. */
- int last_input_index;
-
/* Number of .java and .class source file arguments seen. */
int java_files_count = 0;
int class_files_count = 0;
@@ -384,7 +383,6 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
if (saw_resource)
{
args[i] |= RESOURCE_FILE_ARG;
- last_input_index = i;
added += 2; /* for -xjava and -xnone */
}
@@ -400,13 +398,11 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
{
args[i] |= JAVA_FILE_ARG;
java_files_count++;
- last_input_index = i;
}
if (len > 6 && strcmp (argv[i] + len - 6, ".class") == 0)
{
args[i] |= CLASS_FILE_ARG;
class_files_count++;
- last_input_index = i;
}
if (len > 4
&& (strcmp (argv[i] + len - 4, ".zip") == 0
@@ -414,7 +410,6 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
{
args[i] |= ZIP_FILE_ARG;
zip_files_count++;
- last_input_index = i;
}
}
}
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index 0d9605c09ff..b26092ecdae 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -27,6 +27,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "input.h"
#include "rtl.h"
diff --git a/gcc/java/mangle.c b/gcc/java/mangle.c
index 88aec17dda2..41e0423c7c9 100644
--- a/gcc/java/mangle.c
+++ b/gcc/java/mangle.c
@@ -27,6 +27,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "jcf.h"
#include "tree.h"
#include "java-tree.h"
diff --git a/gcc/java/mangle_name.c b/gcc/java/mangle_name.c
index d46956c983d..f38285edfd6 100644
--- a/gcc/java/mangle_name.c
+++ b/gcc/java/mangle_name.c
@@ -27,6 +27,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "jcf.h"
#include "tree.h"
#include "java-tree.h"
diff --git a/gcc/java/parse-scan.y b/gcc/java/parse-scan.y
index 81ce627216d..00260b0787a 100644
--- a/gcc/java/parse-scan.y
+++ b/gcc/java/parse-scan.y
@@ -39,6 +39,8 @@ definitions and other extensions. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "obstack.h"
#include "toplev.h"
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index d457f1a046d..d117368445f 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -48,6 +48,8 @@ definitions and other extensions. */
%{
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include <dirent.h>
#include "tree.h"
#include "rtl.h"
@@ -5195,7 +5197,9 @@ obtain_incomplete_type (type_name)
else
abort ();
+ /* Workaround from build_pointer_type for incomplete types. */
BUILD_PTR_FROM_NAME (ptr, name);
+ TYPE_MODE (ptr) = ptr_mode;
layout_type (ptr);
return ptr;
@@ -7485,7 +7489,7 @@ source_end_java_method ()
patched. Dump it to a file if the user requested it. */
dump_java_tree (TDI_original, fndecl);
- java_optimize_inline (fndecl);
+ java_optimize_inline (fndecl);
/* Generate function's code */
if (BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (fndecl))
@@ -8145,9 +8149,9 @@ java_expand_method_bodies (class)
/* Save the function for inlining. */
if (flag_inline_trees)
- DECL_SAVED_TREE (decl) =
+ DECL_SAVED_TREE (decl) =
BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (decl));
-
+
/* It's time to assign the variable flagging static class
initialization based on which classes invoked static methods
are definitely initializing. This should be flagged. */
diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c
index 4a1894f641e..ea34cc17bbc 100644
--- a/gcc/java/typeck.c
+++ b/gcc/java/typeck.c
@@ -27,6 +27,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "real.h"
#include "obstack.h"
diff --git a/gcc/java/verify.c b/gcc/java/verify.c
index 250e479b5fc..184d950a356 100644
--- a/gcc/java/verify.c
+++ b/gcc/java/verify.c
@@ -25,6 +25,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "java-tree.h"
#include "javaop.h"
diff --git a/gcc/java/xref.c b/gcc/java/xref.c
index ff1da78c2ea..0bfa6b41c55 100644
--- a/gcc/java/xref.c
+++ b/gcc/java/xref.c
@@ -26,6 +26,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "java-tree.h"
#include "xref.h"
diff --git a/gcc/java/zextract.c b/gcc/java/zextract.c
index 3985cd92001..cdea0d1b1a8 100644
--- a/gcc/java/zextract.c
+++ b/gcc/java/zextract.c
@@ -27,6 +27,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "zipfile.h"
/* This stuff is partly based on the 28 August 1994 public release of the
diff --git a/gcc/jump.c b/gcc/jump.c
index ef031f2a8a1..2476a32eb9d 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -36,6 +36,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tm_p.h"
#include "flags.h"
@@ -59,7 +61,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
or even change what is live at any point.
So perhaps let combiner do it. */
-static int init_label_info PARAMS ((rtx));
+static void init_label_info PARAMS ((rtx));
static void mark_all_labels PARAMS ((rtx));
static int duplicate_loop_exit_test PARAMS ((rtx));
static void delete_computation PARAMS ((rtx));
@@ -78,10 +80,8 @@ rebuild_jump_labels (f)
rtx f;
{
rtx insn;
- int max_uid = 0;
-
- max_uid = init_label_info (f) + 1;
+ init_label_info (f);
mark_all_labels (f);
/* Keep track of labels used from static data; we don't track them
@@ -186,36 +186,29 @@ purge_line_number_notes (f)
/* Initialize LABEL_NUSES and JUMP_LABEL fields. Delete any REG_LABEL
notes whose labels don't occur in the insn any more. Returns the
largest INSN_UID found. */
-static int
+static void
init_label_info (f)
rtx f;
{
- int largest_uid = 0;
rtx insn;
for (insn = f; insn; insn = NEXT_INSN (insn))
- {
- if (GET_CODE (insn) == CODE_LABEL)
- LABEL_NUSES (insn) = (LABEL_PRESERVE_P (insn) != 0);
- else if (GET_CODE (insn) == JUMP_INSN)
- JUMP_LABEL (insn) = 0;
- else if (GET_CODE (insn) == INSN || GET_CODE (insn) == CALL_INSN)
- {
- rtx note, next;
-
- for (note = REG_NOTES (insn); note; note = next)
- {
- next = XEXP (note, 1);
- if (REG_NOTE_KIND (note) == REG_LABEL
- && ! reg_mentioned_p (XEXP (note, 0), PATTERN (insn)))
- remove_note (insn, note);
- }
- }
- if (INSN_UID (insn) > largest_uid)
- largest_uid = INSN_UID (insn);
- }
+ if (GET_CODE (insn) == CODE_LABEL)
+ LABEL_NUSES (insn) = (LABEL_PRESERVE_P (insn) != 0);
+ else if (GET_CODE (insn) == JUMP_INSN)
+ JUMP_LABEL (insn) = 0;
+ else if (GET_CODE (insn) == INSN || GET_CODE (insn) == CALL_INSN)
+ {
+ rtx note, next;
- return largest_uid;
+ for (note = REG_NOTES (insn); note; note = next)
+ {
+ next = XEXP (note, 1);
+ if (REG_NOTE_KIND (note) == REG_LABEL
+ && ! reg_mentioned_p (XEXP (note, 0), PATTERN (insn)))
+ remove_note (insn, note);
+ }
+ }
}
/* Mark the label each jump jumps to.
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index 8de0d6a41f2..458baf58123 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -76,7 +76,7 @@ int lhd_tree_inlining_tree_chain_matters_p PARAMS ((tree));
int lhd_tree_inlining_auto_var_in_fn_p PARAMS ((tree, tree));
tree lhd_tree_inlining_copy_res_decl_for_inlining PARAMS ((tree, tree,
tree, void *,
- int *, void *));
+ int *, tree));
int lhd_tree_inlining_anon_aggr_type_p PARAMS ((tree));
int lhd_tree_inlining_start_inlining PARAMS ((tree));
void lhd_tree_inlining_end_inlining PARAMS ((tree));
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index ccbb53485aa..912d5db7455 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "toplev.h"
#include "tree.h"
#include "c-tree.h"
@@ -354,13 +356,17 @@ lhd_tree_inlining_auto_var_in_fn_p (var, fn)
tree
lhd_tree_inlining_copy_res_decl_for_inlining (res, fn, caller,
- dm, ndp, texps)
+ dm, ndp, return_slot_addr)
tree res, fn, caller;
void *dm ATTRIBUTE_UNUSED;
int *ndp ATTRIBUTE_UNUSED;
- void *texps ATTRIBUTE_UNUSED;
+ tree return_slot_addr ATTRIBUTE_UNUSED;
{
- return copy_decl_for_inlining (res, fn, caller);
+ if (return_slot_addr)
+ return build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (return_slot_addr)),
+ return_slot_addr);
+ else
+ return copy_decl_for_inlining (res, fn, caller);
}
/* lang_hooks.tree_inlining.anon_aggr_type_p determines whether T is a
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index 09e5971007a..32782c1722c 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -48,7 +48,7 @@ struct lang_hooks_for_tree_inlining
union tree_node *,
union tree_node *,
void *, int *,
- void *));
+ tree));
int (*anon_aggr_type_p) PARAMS ((union tree_node *));
bool (*var_mod_type_p) PARAMS ((union tree_node *));
int (*start_inlining) PARAMS ((union tree_node *));
diff --git a/gcc/lcm.c b/gcc/lcm.c
index bdbae429d4d..c43b1b1da66 100644
--- a/gcc/lcm.c
+++ b/gcc/lcm.c
@@ -51,6 +51,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index dea803def0d..ac978ab48ad 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -35,6 +35,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tconfig.h"
#include "tsystem.h"
+#include "coretypes.h"
+#include "tm.h"
/* Don't use `fancy_abort' here even if config.h says to use it. */
#ifdef abort
@@ -933,28 +935,20 @@ __fixxfdi (XFtype a)
DWtype
__fixunsdfDI (DFtype a)
{
- DFtype b;
- UDWtype v;
+ UWtype hi, lo;
- if (a < 0)
- return 0;
+ /* 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;
- /* Compute high word of result, as a flonum. */
- b = (a / HIGH_WORD_COEFF);
- /* Convert that to fixed (but not to DWtype!),
- and shift it into the high word. */
- v = (UWtype) b;
- v <<= WORD_SIZE;
- /* Remove high part from the DFtype, leaving the low part as flonum. */
- a -= (DFtype)v;
- /* Convert that to fixed (but not to DWtype!) and add it in.
- Sometimes A comes out negative. This is significant, since
- A has more bits than a long int does. */
- if (a < 0)
- v -= (UWtype) (- a);
- else
- v += (UWtype) a;
- return v;
+ /* 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);
+
+ /* Assemble result from the two parts. */
+ return ((UDWtype) hi << WORD_SIZE) | lo;
}
#endif
@@ -979,28 +973,20 @@ __fixunssfDI (SFtype original_a)
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;
- DFtype b;
- UDWtype v;
+ UWtype hi, lo;
- if (a < 0)
- return 0;
+ /* 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;
- /* Compute high word of result, as a flonum. */
- b = (a / HIGH_WORD_COEFF);
- /* Convert that to fixed (but not to DWtype!),
- and shift it into the high word. */
- v = (UWtype) b;
- v <<= WORD_SIZE;
- /* Remove high part from the DFtype, leaving the low part as flonum. */
- a -= (DFtype) v;
- /* Convert that to fixed (but not to DWtype!) and add it in.
- Sometimes A comes out negative. This is significant, since
- A has more bits than a long int does. */
- if (a < 0)
- v -= (UWtype) (- a);
- else
- v += (UWtype) a;
- return v;
+ /* 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);
+
+ /* Assemble result from the two parts. */
+ return ((UDWtype) hi << WORD_SIZE) | lo;
}
#endif
@@ -1249,59 +1235,62 @@ __eprintf (const char *string, const char *expression,
#endif
#endif
-#ifdef L_bb
-
-struct bb_function_info {
- long checksum;
- int arc_count;
- const char *name;
-};
-
-/* Structure emitted by --profile-arcs */
-struct bb
-{
- long zero_word;
- const char *filename;
- gcov_type *counts;
- long ncounts;
- struct bb *next;
-
- /* Older GCC's did not emit these fields. */
- long sizeof_bb;
- struct bb_function_info *function_infos;
-};
-
-#ifndef inhibit_libc
+#ifdef L_gcov
-/* Arc profile dumper. Requires atexit and stdio. */
+/* Gcov profile dumper. Requires atexit and stdio. */
#undef NULL /* Avoid errors if stdio.h and our stddef.h mismatch. */
#include <stdio.h>
#include "gcov-io.h"
#include <string.h>
-#ifdef TARGET_HAS_F_SETLKW
+#if defined (TARGET_HAS_F_SETLKW)
#include <fcntl.h>
#include <errno.h>
#endif
-/* Chain of per-object file bb structures. */
-static struct bb *bb_head;
+/* Chain of per-object gcov structures. */
+static struct gcov_info *gcov_list;
-/* Dump the coverage counts. We merge with existing counts when
- possible, to avoid growing the .da files ad infinitum. */
+/* A program checksum allows us to distinguish program data for an
+ object file included in multiple programs. */
+static unsigned gcov_crc32;
-void
-__bb_exit_func (void)
+static void
+gcov_version_mismatch (struct gcov_info *ptr, unsigned version)
+{
+ unsigned expected = GCOV_VERSION;
+ unsigned ix;
+ char e[4], v[4];
+
+ for (ix = 4; ix--; expected >>= 8, version >>= 8)
+ {
+ e[ix] = expected;
+ v[ix] = version;
+ }
+
+ fprintf (stderr,
+ "profiling:%s:Version mismatch - expected %.4s got %.4s\n",
+ ptr->filename, e, v);
+}
+
+/* Dump the coverage counts. We merge with existing counts when
+ possible, to avoid growing the .da files ad infinitum. We use this
+ program's checksum to make sure we only accumulate whole program
+ statistics to the correct summary. An object file might be embedded
+ in two separate programs, and we must keep the two program
+ summaries separate. */
+
+static void
+gcov_exit (void)
{
- struct bb *ptr;
- int i;
+ struct gcov_info *ptr;
+ unsigned ix, jx;
+ struct gcov_summary program;
+ gcov_type program_max_one = 0;
+ gcov_type program_max_sum = 0;
gcov_type program_sum = 0;
- gcov_type program_max = 0;
- long program_arcs = 0;
- gcov_type merged_sum = 0;
- gcov_type merged_max = 0;
- long merged_arcs = 0;
+ unsigned program_arcs = 0;
#if defined (TARGET_HAS_F_SETLKW)
struct flock s_flock;
@@ -1313,52 +1302,45 @@ __bb_exit_func (void)
s_flock.l_pid = getpid ();
#endif
- /* Non-merged stats for this program. */
- for (ptr = bb_head; ptr; ptr = ptr->next)
- {
- for (i = 0; i < ptr->ncounts; i++)
- {
- program_sum += ptr->counts[i];
-
- if (ptr->counts[i] > program_max)
- program_max = ptr->counts[i];
- }
- program_arcs += ptr->ncounts;
- }
+ memset (&program, 0, sizeof (program));
+ program.checksum = gcov_crc32;
- for (ptr = bb_head; ptr; ptr = ptr->next)
+ for (ptr = gcov_list; ptr; ptr = ptr->next)
{
FILE *da_file;
- gcov_type object_max = 0;
- gcov_type object_sum = 0;
- long object_functions = 0;
+ struct gcov_summary object;
+ struct gcov_summary local_prg;
int merging = 0;
- int error = 0;
- struct bb_function_info *fn_info;
+ long base;
+ const struct function_info *fn_info;
gcov_type *count_ptr;
+ gcov_type object_max_one = 0;
+
+ ptr->wkspc = 0;
+ if (!ptr->filename)
+ continue;
+
+ for (ix = ptr->n_arc_counts, count_ptr = ptr->arc_counts; ix--;)
+ {
+ gcov_type count = *count_ptr++;
+
+ if (count > object_max_one)
+ object_max_one = count;
+ }
+ if (object_max_one > program_max_one)
+ program_max_one = object_max_one;
- /* Open for modification */
- da_file = fopen (ptr->filename, "r+b");
+ memset (&local_prg, 0, sizeof (local_prg));
+ memset (&object, 0, sizeof (object));
- if (da_file)
+ /* Open for modification */
+ if ((da_file = fopen (ptr->filename, "r+b")))
merging = 1;
+ else if ((da_file = fopen (ptr->filename, "w+b")))
+ ;
else
{
- /* Try for appending */
- da_file = fopen (ptr->filename, "ab");
- /* Some old systems might not allow the 'b' mode modifier.
- Therefore, try to open without it. This can lead to a
- race condition so that when you delete and re-create the
- file, the file might be opened in text mode, but then,
- you shouldn't delete the file in the first place. */
- if (!da_file)
- da_file = fopen (ptr->filename, "a");
- }
-
- if (!da_file)
- {
- fprintf (stderr, "arc profiling: Can't open output file %s.\n",
- ptr->filename);
+ fprintf (stderr, "profiling:%s:Cannot open\n", ptr->filename);
ptr->filename = 0;
continue;
}
@@ -1371,152 +1353,248 @@ __bb_exit_func (void)
&& errno == EINTR)
continue;
#endif
- for (fn_info = ptr->function_infos; fn_info->arc_count != -1; fn_info++)
- object_functions++;
-
if (merging)
{
/* Merge data from file. */
- long tmp_long;
- gcov_type tmp_gcov;
-
- if (/* magic */
- (__read_long (&tmp_long, da_file, 4) || tmp_long != -123l)
- /* functions in object file. */
- || (__read_long (&tmp_long, da_file, 4)
- || tmp_long != object_functions)
- /* extension block, skipped */
- || (__read_long (&tmp_long, da_file, 4)
- || fseek (da_file, tmp_long, SEEK_CUR)))
+ unsigned tag, length;
+
+ if (gcov_read_unsigned (da_file, &tag) || tag != GCOV_DATA_MAGIC)
{
- read_error:;
- fprintf (stderr, "arc profiling: Error merging output file %s.\n",
+ fprintf (stderr, "profiling:%s:Not a gcov data file\n",
ptr->filename);
- clearerr (da_file);
+ read_fatal:;
+ fclose (da_file);
+ ptr->filename = 0;
+ continue;
}
- else
+ if (gcov_read_unsigned (da_file, &length) || length != GCOV_VERSION)
{
- /* Merge execution counts for each function. */
- count_ptr = ptr->counts;
-
- for (fn_info = ptr->function_infos; fn_info->arc_count != -1;
- fn_info++)
+ gcov_version_mismatch (ptr, length);
+ goto read_fatal;
+ }
+
+ /* Merge execution counts for each function. */
+ count_ptr = ptr->arc_counts;
+ for (ix = ptr->n_functions, fn_info = ptr->functions;
+ ix--; fn_info++)
+ {
+ if (gcov_read_unsigned (da_file, &tag)
+ || gcov_read_unsigned (da_file, &length))
{
- if (/* function name delim */
- (__read_long (&tmp_long, da_file, 4)
- || tmp_long != -1)
- /* function name length */
- || (__read_long (&tmp_long, da_file, 4)
- || tmp_long != (long) strlen (fn_info->name))
- /* skip string */
- || fseek (da_file, ((tmp_long + 1) + 3) & ~3, SEEK_CUR)
- /* function name delim */
- || (__read_long (&tmp_long, da_file, 4)
- || tmp_long != -1))
- goto read_error;
+ read_error:;
+ fprintf (stderr, "profiling:%s:Error merging\n",
+ ptr->filename);
+ goto read_fatal;
+ }
- if (/* function checksum */
- (__read_long (&tmp_long, da_file, 4)
- || tmp_long != fn_info->checksum)
- /* arc count */
- || (__read_long (&tmp_long, da_file, 4)
- || tmp_long != fn_info->arc_count))
+ /* Check function */
+ if (tag != GCOV_TAG_FUNCTION)
+ {
+ read_mismatch:;
+ fprintf (stderr, "profiling:%s:Merge mismatch at %s\n",
+ ptr->filename, fn_info->name);
+ goto read_fatal;
+ }
+ {
+ unsigned flength, checksum;
+
+ if (gcov_read_unsigned (da_file, &flength)
+ || gcov_skip_string (da_file, flength)
+ || gcov_read_unsigned (da_file, &checksum))
+ goto read_error;
+ if (flength != strlen (fn_info->name)
+ || checksum != fn_info->checksum)
+ goto read_mismatch;
+ }
+ /* Check arc counts */
+ if (gcov_read_unsigned (da_file, &tag)
+ || gcov_read_unsigned (da_file, &length))
+ goto read_error;
+ if (tag != GCOV_TAG_ARC_COUNTS
+ || length / 8 != fn_info->n_arc_counts)
+ goto read_mismatch;
+ {
+ gcov_type count;
+
+ for (jx = fn_info->n_arc_counts; jx--; count_ptr++)
+ if (gcov_read_counter (da_file, &count))
goto read_error;
-
- for (i = fn_info->arc_count; i > 0; i--, count_ptr++)
- if (__read_gcov_type (&tmp_gcov, da_file, 8))
- goto read_error;
- else
- *count_ptr += tmp_gcov;
+ else
+ *count_ptr += count;
+ }
+ }
+
+ /* Check object summary */
+ if (gcov_read_unsigned (da_file, &tag)
+ || gcov_read_unsigned (da_file, &length))
+ goto read_error;
+ if (tag != GCOV_TAG_OBJECT_SUMMARY)
+ goto read_mismatch;
+ if (gcov_read_summary (da_file, &object))
+ goto read_error;
+
+ /* Check program summary */
+ while (1)
+ {
+ long base = ftell (da_file);
+
+ if (gcov_read_unsigned (da_file, &tag)
+ || gcov_read_unsigned (da_file, &length))
+ {
+ if (feof (da_file))
+ break;
+ goto read_error;
+ }
+ if (tag != GCOV_TAG_PROGRAM_SUMMARY
+ && tag != GCOV_TAG_PLACEHOLDER_SUMMARY
+ && tag != GCOV_TAG_INCORRECT_SUMMARY)
+ goto read_mismatch;
+ if (gcov_read_summary (da_file, &local_prg))
+ goto read_error;
+ if (local_prg.checksum != program.checksum)
+ continue;
+ if (tag == GCOV_TAG_PLACEHOLDER_SUMMARY)
+ {
+ fprintf (stderr,
+ "profiling:%s:Concurrent race detected\n",
+ ptr->filename);
+ goto read_fatal;
+ }
+ merging = -1;
+ if (tag != GCOV_TAG_PROGRAM_SUMMARY)
+ break;
+
+ if (program.runs
+ && memcmp (&program, &local_prg, sizeof (program)))
+ {
+ fprintf (stderr, "profiling:%s:Invocation mismatch\n",
+ ptr->filename);
+ local_prg.runs = 0;
}
+ else
+ memcpy (&program, &local_prg, sizeof (program));
+ ptr->wkspc = base;
+ break;
}
fseek (da_file, 0, SEEK_SET);
}
-
- /* Calculate the per-object statistics. */
- for (i = 0; i < ptr->ncounts; i++)
- {
- object_sum += ptr->counts[i];
- if (ptr->counts[i] > object_max)
- object_max = ptr->counts[i];
- }
- merged_sum += object_sum;
- if (merged_max < object_max)
- merged_max = object_max;
- merged_arcs += ptr->ncounts;
+ object.runs++;
+ object.arcs = ptr->n_arc_counts;
+ object.arc_sum = 0;
+ if (object.arc_max_one < object_max_one)
+ object.arc_max_one = object_max_one;
+ object.arc_sum_max += object_max_one;
/* Write out the data. */
if (/* magic */
- __write_long (-123, da_file, 4)
- /* number of functions in object file. */
- || __write_long (object_functions, da_file, 4)
- /* length of extra data in bytes. */
- || __write_long ((4 + 8 + 8) + (4 + 8 + 8), da_file, 4)
-
- /* whole program statistics. If merging write per-object
- now, rewrite later */
- /* number of instrumented arcs. */
- || __write_long (merging ? ptr->ncounts : program_arcs, da_file, 4)
- /* sum of counters. */
- || __write_gcov_type (merging ? object_sum : program_sum, da_file, 8)
- /* maximal counter. */
- || __write_gcov_type (merging ? object_max : program_max, da_file, 8)
-
- /* per-object statistics. */
- /* number of counters. */
- || __write_long (ptr->ncounts, da_file, 4)
- /* sum of counters. */
- || __write_gcov_type (object_sum, da_file, 8)
- /* maximal counter. */
- || __write_gcov_type (object_max, da_file, 8))
+ gcov_write_unsigned (da_file, GCOV_DATA_MAGIC)
+ /* version number */
+ || gcov_write_unsigned (da_file, GCOV_VERSION))
{
write_error:;
- fprintf (stderr, "arc profiling: Error writing output file %s.\n",
- ptr->filename);
- error = 1;
+ fclose (da_file);
+ fprintf (stderr, "profiling:%s:Error writing\n", ptr->filename);
+ ptr->filename = 0;
+ continue;
}
- else
+
+ /* Write execution counts for each function. */
+ count_ptr = ptr->arc_counts;
+ for (ix = ptr->n_functions, fn_info = ptr->functions; ix--; fn_info++)
{
- /* Write execution counts for each function. */
- count_ptr = ptr->counts;
-
- for (fn_info = ptr->function_infos; fn_info->arc_count != -1;
- fn_info++)
+ /* Announce function. */
+ if (gcov_write_unsigned (da_file, GCOV_TAG_FUNCTION)
+ || !(base = gcov_reserve_length (da_file))
+ /* function name */
+ || gcov_write_string (da_file, fn_info->name,
+ strlen (fn_info->name))
+ /* function checksum */
+ || gcov_write_unsigned (da_file, fn_info->checksum)
+ || gcov_write_length (da_file, base))
+ goto write_error;
+
+ /* arc counts. */
+ if (gcov_write_unsigned (da_file, GCOV_TAG_ARC_COUNTS)
+ || !(base = gcov_reserve_length (da_file)))
+ goto write_error;
+
+ for (jx = fn_info->n_arc_counts; jx--;)
{
- if (__write_gcov_string (fn_info->name,
- strlen (fn_info->name), da_file, -1)
- || __write_long (fn_info->checksum, da_file, 4)
- || __write_long (fn_info->arc_count, da_file, 4))
- goto write_error;
+ gcov_type count = *count_ptr++;
- for (i = fn_info->arc_count; i > 0; i--, count_ptr++)
- if (__write_gcov_type (*count_ptr, da_file, 8))
- goto write_error; /* RIP Edsger Dijkstra */
+ object.arc_sum += count;
+ if (object.arc_max_sum < count)
+ object.arc_max_sum = count;
+ if (gcov_write_counter (da_file, count))
+ goto write_error; /* RIP Edsger Dijkstra */
}
+ if (gcov_write_length (da_file, base))
+ goto write_error;
+ }
+
+ /* Object file summary. */
+ if (gcov_write_summary (da_file, GCOV_TAG_OBJECT_SUMMARY, &object))
+ goto write_error;
+
+ if (merging >= 0)
+ {
+ if (fseek (da_file, 0, SEEK_END))
+ goto write_error;
+ ptr->wkspc = ftell (da_file);
+ if (gcov_write_summary (da_file, GCOV_TAG_PLACEHOLDER_SUMMARY,
+ &program))
+ goto write_error;
+ }
+ else if (ptr->wkspc)
+ {
+ /* Zap trailing program summary */
+ if (fseek (da_file, ptr->wkspc, SEEK_SET))
+ goto write_error;
+ if (!local_prg.runs)
+ ptr->wkspc = 0;
+ if (gcov_write_unsigned (da_file,
+ local_prg.runs ? GCOV_TAG_PLACEHOLDER_SUMMARY
+ : GCOV_TAG_INCORRECT_SUMMARY))
+ goto write_error;
}
+ if (fflush (da_file))
+ goto write_error;
if (fclose (da_file))
{
- fprintf (stderr, "arc profiling: Error closing output file %s.\n",
- ptr->filename);
- error = 1;
+ fprintf (stderr, "profiling:%s:Error closing\n", ptr->filename);
+ ptr->filename = 0;
+ }
+ else
+ {
+ program_arcs += ptr->n_arc_counts;
+ program_sum += object.arc_sum;
+ if (program_max_sum < object.arc_max_sum)
+ program_max_sum = object.arc_max_sum;
}
- if (error || !merging)
- ptr->filename = 0;
}
+ /* Generate whole program statistics. */
+ program.runs++;
+ program.arcs = program_arcs;
+ program.arc_sum = program_sum;
+ if (program.arc_max_one < program_max_one)
+ program.arc_max_one = program_max_one;
+ if (program.arc_max_sum < program_max_sum)
+ program.arc_max_sum = program_max_sum;
+ program.arc_sum_max += program_max_one;
+
/* Upate whole program statistics. */
- for (ptr = bb_head; ptr; ptr = ptr->next)
- if (ptr->filename)
+ for (ptr = gcov_list; ptr; ptr = ptr->next)
+ if (ptr->filename && ptr->wkspc)
{
FILE *da_file;
da_file = fopen (ptr->filename, "r+b");
if (!da_file)
{
- fprintf (stderr, "arc profiling: Cannot reopen %s.\n",
- ptr->filename);
+ fprintf (stderr, "profiling:%s:Cannot open\n", ptr->filename);
continue;
}
@@ -1525,19 +1603,12 @@ __bb_exit_func (void)
&& errno == EINTR)
continue;
#endif
-
- if (fseek (da_file, 4 * 3, SEEK_SET)
- /* number of instrumented arcs. */
- || __write_long (merged_arcs, da_file, 4)
- /* sum of counters. */
- || __write_gcov_type (merged_sum, da_file, 8)
- /* maximal counter. */
- || __write_gcov_type (merged_max, da_file, 8))
- fprintf (stderr, "arc profiling: Error updating program header %s.\n",
- ptr->filename);
+ if (fseek (da_file, ptr->wkspc, SEEK_SET)
+ || gcov_write_summary (da_file, GCOV_TAG_PROGRAM_SUMMARY, &program)
+ || fflush (da_file))
+ fprintf (stderr, "profiling:%s:Error writing\n", ptr->filename);
if (fclose (da_file))
- fprintf (stderr, "arc profiling: Error reclosing %s\n",
- ptr->filename);
+ fprintf (stderr, "profiling:%s:Error closing\n", ptr->filename);
}
}
@@ -1545,19 +1616,42 @@ __bb_exit_func (void)
when running an object file's global ctors. */
void
-__bb_init_func (struct bb *blocks)
+__gcov_init (struct gcov_info *info)
{
- if (blocks->zero_word)
+ if (!info->version)
return;
+ if (info->version != GCOV_VERSION)
+ gcov_version_mismatch (info, info->version);
+ else
+ {
+ const char *ptr = info->filename;
+ unsigned crc32 = gcov_crc32;
+
+ do
+ {
+ unsigned ix;
+ unsigned value = *ptr << 24;
- /* Initialize destructor and per-thread data. */
- if (!bb_head)
- atexit (__bb_exit_func);
+ for (ix = 8; ix--; value <<= 1)
+ {
+ unsigned feedback;
- /* Set up linked list. */
- blocks->zero_word = 1;
- blocks->next = bb_head;
- bb_head = blocks;
+ feedback = (value ^ crc32) & 0x80000000 ? 0x04c11db7 : 0;
+ crc32 <<= 1;
+ crc32 ^= feedback;
+ }
+ }
+ while (*ptr++);
+
+ gcov_crc32 = crc32;
+
+ if (!gcov_list)
+ atexit (gcov_exit);
+
+ info->next = gcov_list;
+ gcov_list = info;
+ }
+ info->version = 0;
}
/* Called before fork or exec - write out profile information gathered so
@@ -1565,21 +1659,21 @@ __bb_init_func (struct bb *blocks)
profile information gathered so far. */
void
-__bb_fork_func (void)
+__gcov_flush (void)
{
- struct bb *ptr;
+ struct gcov_info *ptr;
- __bb_exit_func ();
- for (ptr = bb_head; ptr != (struct bb *) 0; ptr = ptr->next)
+ gcov_exit ();
+ for (ptr = gcov_list; ptr; ptr = ptr->next)
{
- long i;
- for (i = ptr->ncounts - 1; i >= 0; i--)
- ptr->counts[i] = 0;
+ unsigned i;
+
+ for (i = ptr->n_arc_counts; i--;)
+ ptr->arc_counts[i] = 0;
}
}
-#endif /* not inhibit_libc */
-#endif /* L_bb */
+#endif /* L_gcov */
#ifdef L_clear_cache
/* Clear part of an instruction cache. */
diff --git a/gcc/libgcc2.h b/gcc/libgcc2.h
index 79c79970057..260cd7c9f57 100644
--- a/gcc/libgcc2.h
+++ b/gcc/libgcc2.h
@@ -27,19 +27,6 @@ extern void __clear_cache (char *, char *);
extern void __eprintf (const char *, const char *, unsigned int, const char *)
__attribute__ ((__noreturn__));
-struct bb;
-extern void __bb_exit_func (void);
-extern void __bb_init_func (struct bb *);
-extern void __bb_fork_func (void);
-
-#if LONG_TYPE_SIZE == GCOV_TYPE_SIZE
-typedef long gcov_type;
-#else
-typedef long long gcov_type;
-#endif
-
-extern gcov_type *__bb_find_arc_counters (void);
-
struct exception_descriptor;
extern short int __get_eh_table_language (struct exception_descriptor *);
extern short int __get_eh_table_version (struct exception_descriptor *);
diff --git a/gcc/line-map.c b/gcc/line-map.c
index a0f3ee50bc0..ae26e76a1ef 100644
--- a/gcc/line-map.c
+++ b/gcc/line-map.c
@@ -22,6 +22,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "line-map.h"
#include "intl.h"
diff --git a/gcc/lists.c b/gcc/lists.c
index 58d90d37756..78accceccd8 100644
--- a/gcc/lists.c
+++ b/gcc/lists.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "toplev.h"
#include "rtl.h"
#include "ggc.h"
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index c2d6c0c610b..7f07be6c144 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -61,6 +61,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "hard-reg-set.h"
#include "rtl.h"
#include "tm_p.h"
diff --git a/gcc/loop.c b/gcc/loop.c
index d7abe5ff654..b3a8d2818d5 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -36,6 +36,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tm_p.h"
#include "function.h"
@@ -169,10 +171,6 @@ struct loop **uid_loop;
int max_uid_for_loop;
-/* 1 + luid of last insn. */
-
-static int max_luid;
-
/* Number of loops detected in current function. Used as index to the
next few tables. */
@@ -522,7 +520,7 @@ loop_optimize (f, dumpfile, flags)
/* find_and_verify_loops has already called compute_luids, but it
might have rearranged code afterwards, so we need to recompute
the luids now. */
- max_luid = compute_luids (f, NULL_RTX, 0);
+ compute_luids (f, NULL_RTX, 0);
/* Don't leave gaps in uid_luid for insns that have been
deleted. It is possible that the first or last insn
@@ -616,8 +614,6 @@ scan_loop (loop, flags)
/* 1 if we are scanning insns that might never be executed
due to a subroutine call which might exit before they are reached. */
int call_passed = 0;
- /* Jump insn that enters the loop, or 0 if control drops in. */
- rtx loop_entry_jump = 0;
/* Number of insns in the loop. */
int insn_count;
int tem;
@@ -685,24 +681,20 @@ scan_loop (loop, flags)
Start scan from there.
But record in LOOP->TOP the place where the end-test jumps
back to so we can scan that after the end of the loop. */
- if (GET_CODE (p) == JUMP_INSN)
- {
- loop_entry_jump = p;
-
+ if (GET_CODE (p) == JUMP_INSN
/* Loop entry must be unconditional jump (and not a RETURN) */
- if (any_uncondjump_p (p)
- && JUMP_LABEL (p) != 0
- /* Check to see whether the jump actually
- jumps out of the loop (meaning it's no loop).
- This case can happen for things like
- do {..} while (0). If this label was generated previously
- by loop, we can't tell anything about it and have to reject
- the loop. */
- && INSN_IN_RANGE_P (JUMP_LABEL (p), loop_start, loop_end))
- {
- loop->top = next_label (loop->scan_start);
- loop->scan_start = JUMP_LABEL (p);
- }
+ && any_uncondjump_p (p)
+ && JUMP_LABEL (p) != 0
+ /* Check to see whether the jump actually
+ jumps out of the loop (meaning it's no loop).
+ This case can happen for things like
+ do {..} while (0). If this label was generated previously
+ by loop, we can't tell anything about it and have to reject
+ the loop. */
+ && INSN_IN_RANGE_P (JUMP_LABEL (p), loop_start, loop_end))
+ {
+ loop->top = next_label (loop->scan_start);
+ loop->scan_start = JUMP_LABEL (p);
}
/* If LOOP->SCAN_START was an insn created by loop, we don't know its luid
@@ -5949,12 +5941,8 @@ check_final_value (loop, v)
const struct loop *loop;
struct induction *v;
{
- struct loop_ivs *ivs = LOOP_IVS (loop);
- struct iv_class *bl;
rtx final_value = 0;
- bl = REG_IV_CLASS (ivs, REGNO (v->src_reg));
-
/* DEST_ADDR givs will never reach here, because they are always marked
replaceable above in record_giv. */
diff --git a/gcc/machmode.def b/gcc/machmode.def
index 5013e1f7cbe..6cb912c4536 100644
--- a/gcc/machmode.def
+++ b/gcc/machmode.def
@@ -134,13 +134,16 @@ DEF_MACHMODE (V8DImode, "V8DI", MODE_VECTOR_INT, BITS_PER_UNIT*64, 64, 8, VOIDmo
DEF_MACHMODE (V16QImode, "V16QI", MODE_VECTOR_INT, BITS_PER_UNIT*16, 16, 1, V8HImode, QImode)
+DEF_MACHMODE (V2HFmode, "V2HF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*4, 4, 2, V4HFmode, HFmode)
DEF_MACHMODE (V2SFmode, "V2SF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*8, 8, 4, V4SFmode, SFmode)
DEF_MACHMODE (V2DFmode, "V2DF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*16, 16, 8, V8SFmode, DFmode)
+DEF_MACHMODE (V4HFmode, "V4HF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*8, 8, 2, V2SFmode, HFmode)
DEF_MACHMODE (V4SFmode, "V4SF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*16, 16, 4, V2DFmode, SFmode)
DEF_MACHMODE (V4DFmode, "V4DF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*32, 32, 8, V8DFmode, DFmode)
-DEF_MACHMODE (V8SFmode, "V8SF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*32, 32, 4,V4DFmode, SFmode)
+DEF_MACHMODE (V8HFmode, "V8HF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*16, 16, 2, V4SFmode, HFmode)
+DEF_MACHMODE (V8SFmode, "V8SF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*32, 32, 4, V4DFmode, SFmode)
DEF_MACHMODE (V8DFmode, "V8DF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*64, 64, 8, VOIDmode, DFmode)
DEF_MACHMODE (V16SFmode, "V16SF", MODE_VECTOR_FLOAT, 512, 64, 4, VOIDmode, SFmode)
diff --git a/gcc/main.c b/gcc/main.c
index 49418bd05d7..07fa246b419 100644
--- a/gcc/main.c
+++ b/gcc/main.c
@@ -19,6 +19,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "toplev.h"
int main PARAMS ((int argc, char **argv));
diff --git a/gcc/mbchar.c b/gcc/mbchar.c
index 42517369d70..2767235457f 100644
--- a/gcc/mbchar.c
+++ b/gcc/mbchar.c
@@ -32,6 +32,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#ifdef MULTIBYTE_CHARS
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "mbchar.h"
#include <locale.h>
diff --git a/gcc/mips-tdump.c b/gcc/mips-tdump.c
index d7040d95b70..4c88325f6e6 100644
--- a/gcc/mips-tdump.c
+++ b/gcc/mips-tdump.c
@@ -23,6 +23,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#ifdef index
#undef index
#endif
diff --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c
index e354c9108f0..0f72aee7c0e 100644
--- a/gcc/mips-tfile.c
+++ b/gcc/mips-tfile.c
@@ -602,6 +602,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "version.h"
#include "intl.h"
diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh
index cc87ccb37e8..64d118f1a99 100644
--- a/gcc/mkconfig.sh
+++ b/gcc/mkconfig.sh
@@ -1,12 +1,32 @@
#! /bin/sh
-# Generate gcc's config.h, which is not your normal autoconf-generated
-# config.h (that's auto-(host|build).h). $1 is the file to generate.
-# TM_DEFINES, HEADERS, XM_DEFINES, and possibly TARGET_CPU_DEFAULT are
-# expected to be set in the environment.
+# Copyright (C) 2001, 2002 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.
+
+
+# Generate gcc's various configuration headers:
+# config.h, tconfig.h, bconfig.h, tm.h, and tm_p.h.
+# $1 is the file to generate. DEFINES, HEADERS, and possibly
+# TARGET_CPU_DEFAULT are expected to be set in the environment.
if [ -z "$1" ]; then
- echo "Usage: TM_DEFINES='list' HEADERS='list' XM_DEFINES='list' mkconfig.sh FILE" >&2
+ echo "Usage: DEFINES='list' HEADERS='list' \\" >&2
+ echo " [TARGET_CPU_DEFAULT='default'] mkconfig.sh FILE" >&2
exit 1
fi
@@ -19,8 +39,8 @@ if [ "$TARGET_CPU_DEFAULT" != "" ]; then
echo "#define TARGET_CPU_DEFAULT ($TARGET_CPU_DEFAULT)" >> ${output}T
fi
-# Provide defines for other target machine macros to be used everywhere.
-for def in $TM_DEFINES; do
+# Provide defines for other macros set in config.gcc for this file.
+for def in $DEFINES; do
echo "#ifndef $def" | sed 's/=.*//' >> ${output}T
echo "# define $def" | sed 's/=/ /' >> ${output}T
echo "#endif" >> ${output}T
@@ -29,66 +49,35 @@ done
# The first entry in HEADERS may be auto-host.h or auto-build.h;
# it wants to be included even when not -DIN_GCC.
if [ -n "$HEADERS" ]; then
- set $HEADERS; first=$1
- case $first in auto-* )
- echo "#include \"$first\"" >> ${output}T
+ set $HEADERS
+ case "$1" in auto-* )
+ echo "#include \"$1\"" >> ${output}T
shift
- HEADERS=$*
;;
esac
+ if [ $# -ge 1 ]; then
+ echo '#ifdef IN_GCC' >> ${output}T
+ for file in "$@"; do
+ echo "# include \"$file\"" >> ${output}T
+ done
+ echo '#endif' >> ${output}T
+ fi
fi
-# Provide three core typedefs used by everything, if we are compiling
-# GCC. These used to be found in rtl.h and tree.h, but this is no
-# longer practical. Providing these in config.h/tconfig.h/hconfig.h
-# rather than system.h allows the typedefs to be used anywhere in GCC.
-case $output in
- *config.h | *hconfig.h | *tconfig.h)
- cat >> ${output}T <<EOF
-#ifdef IN_GCC
-/* Provide three core typedefs used by everything, if we are compiling
- GCC. These used to be found in rtl.h and tree.h, but this is no
- longer practical. Providing these here rather that system.h allows
- the typedefs to be used everywhere within GCC. */
-struct rtx_def;
-typedef struct rtx_def *rtx;
-struct rtvec_def;
-typedef struct rtvec_def *rtvec;
-union tree_node;
-typedef union tree_node *tree;
-#endif
-#define GTY(x)
-EOF
- ;;
-esac
+# If this is tconfig.h, now define USED_FOR_TARGET. If this is tm.h,
+# now include insn-constants.h and insn-flags.h only if IN_GCC is
+# defined but neither GENERATOR_FILE nor USED_FOR_TARGET is defined.
+# (Much of this is temporary.)
-if [ -n "$HEADERS" ]; then
- echo '#ifdef IN_GCC' >> ${output}T
- for file in $HEADERS; do
- echo "# include \"$file\"" >> ${output}T
- done
- echo '#endif' >> ${output}T
-fi
-
-for def in $XM_DEFINES; do
- echo "#ifndef $def" | sed 's/=.*//' >> ${output}T
- echo "# define $def" | sed 's/=/ /' >> ${output}T
- echo "#endif" >> ${output}T
-done
-
-# If this is tm_p.h, include tm-preds.h unconditionally.
-# If this is tconfig.h or hconfig.h, include no more files.
-# Otherwise, include insn-constants.h and insn-flags.h,
-# but only if GENERATOR_FILE is not defined.
case $output in
- *tm_p.h)
- echo "#include \"tm-preds.h\"" >> ${output}T
- ;;
- *tconfig.h | *hconfig.h)
+ tconfig.h )
+ cat >> ${output}T <<EOF
+#define USED_FOR_TARGET
+EOF
;;
- *)
+ tm.h )
cat >> ${output}T <<EOF
-#ifndef GENERATOR_FILE
+#if defined IN_GCC && !defined GENERATOR_FILE && !defined USED_FOR_TARGET
# include "insn-constants.h"
# include "insn-flags.h"
#endif
diff --git a/gcc/mkdeps.c b/gcc/mkdeps.c
index 2c300631271..26504e14afa 100644
--- a/gcc/mkdeps.c
+++ b/gcc/mkdeps.c
@@ -22,6 +22,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "mkdeps.h"
/* Keep this structure local to this file, so clients don't find it
diff --git a/gcc/mklibgcc.in b/gcc/mklibgcc.in
index 81d2e47f52b..820230b94c3 100644
--- a/gcc/mklibgcc.in
+++ b/gcc/mklibgcc.in
@@ -61,7 +61,7 @@ make_compile='$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
LANGUAGES="$(LANGUAGES)"'
# Dependencies for libgcc2.c
-libgcc2_c_dep='stmp-dirs $(srcdir)/libgcc2.c $(CONFIG_H) $(MACHMODE_H) longlong.h gbl-ctors.h config.status stmp-int-hdrs tsystem.h'" $LIB2ADDEHDEP"
+libgcc2_c_dep='stmp-dirs $(srcdir)/libgcc2.c $(CONFIG_H) coretypes.h $(TM_H) $(MACHMODE_H) longlong.h gbl-ctors.h config.status stmp-int-hdrs tsystem.h'" $LIB2ADDEHDEP"
# Dependencies for fp-bit.c
fpbit_c_dep='stmp-dirs config.status tsystem.h'
@@ -286,7 +286,7 @@ for ml in $MULTILIBS; do
# .oS objects will have all non-local symbol definitions .hidden
oS=`echo ${o} | sed s~${objext}'$~.oS~g'`
echo "${oS}: stmp-dirs ${o}"
- echo ' @$(NM_FOR_TARGET) '${SHLIB_NM_FLAGS} ${o}' | $(AWK) '\''NF == 3 { print "\t.hidden", $$3 }'\'' | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) '${flags}' -r -nostdinc -nostdlib -o $@ '${o}' -xassembler -'
+ echo ' $(NM_FOR_TARGET) '${SHLIB_NM_FLAGS} ${o}' | $(AWK) '\''NF == 3 { print "\t.hidden", $$3 }'\'' | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) '${flags}' -r -nostdinc -nostdlib -o $@ '${o}' -xassembler -'
libgcc_a_objs="${libgcc_a_objs} ${oS}"
done
fi
diff --git a/gcc/objc/Make-lang.in b/gcc/objc/Make-lang.in
index 480f96b3f9e..949e406734f 100644
--- a/gcc/objc/Make-lang.in
+++ b/gcc/objc/Make-lang.in
@@ -48,27 +48,27 @@ OBJECTIVE-C objective-c: cc1obj$(exeext)
objc-warn = $(STRICT_WARN)
# Language-specific object files for Objective C.
-OBJC_OBJS = objc-lang.o objc-parse.o objc-act.o $(C_AND_OBJC_OBJS)
+OBJC_OBJS = objc/objc-lang.o objc/objc-parse.o objc/objc-act.o
-cc1obj$(exeext): $(OBJC_OBJS) $(BACKEND) $(LIBDEPS)
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(OBJC_OBJS) $(BACKEND) $(LIBS)
+cc1obj$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) $(BACKEND) $(LIBDEPS)
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
+ $(OBJC_OBJS) $(C_AND_OBJC_OBJS) $(BACKEND) $(LIBS)
# Objective C language specific files.
-objc-lang.o : $(srcdir)/objc/objc-lang.c \
- $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(srcdir)/c-tree.h \
- $(srcdir)/c-common.h $(srcdir)/toplev.h $(srcdir)/objc/objc-act.h \
- $(srcdir)/langhooks.h $(srcdir)/langhooks-def.h
- $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/objc \
- -c $(srcdir)/objc/objc-lang.c $(OUTPUT_OPTION)
-
-objc-parse.o : $(srcdir)/objc/objc-parse.c \
- $(CONFIG_H) $(TREE_H) $(C_COMMON_H) $(srcdir)/toplev.h $(srcdir)/ggc.h \
- $(srcdir)/c-pragma.h $(srcdir)/c-tree.h \
- $(srcdir)/input.h $(srcdir)/flags.h $(srcdir)/output.h \
- $(srcdir)/objc/objc-act.h $(SYSTEM_H)
- $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/objc \
- -c $(srcdir)/objc/objc-parse.c $(OUTPUT_OPTION)
+objc/objc-lang.o : objc/objc-lang.c \
+ $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) c-tree.h \
+ c-common.h toplev.h objc/objc-act.h langhooks.h $(LANGHOOKS_DEF_H)
+
+objc/objc-parse.o : objc/objc-parse.c \
+ $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \
+ toplev.h $(GGC_H) c-pragma.h input.h flags.h output.h objc/objc-act.h
+
+objc/objc-act.o : objc/objc-act.c \
+ $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) $(EXPR_H) \
+ $(TARGET_H) $(C_TREE_H) diagnostic.h toplev.h flags.h objc/objc-act.h \
+ input.h function.h output.h debug.h langhooks.h $(LANGHOOKS_DEF_H) \
+ gtype-objc.h
po-generated: $(srcdir)/objc/objc-parse.c
$(srcdir)/objc/objc-parse.c : $(srcdir)/objc/objc-parse.y
@@ -88,15 +88,6 @@ $(srcdir)/objc/objc-parse.y: $(srcdir)/c-parse.in
$(srcdir)/c-parse.in >>tmp-objc-prs.y
$(SHELL) $(srcdir)/move-if-change tmp-objc-prs.y $(srcdir)/objc/objc-parse.y
-objc-act.o : $(srcdir)/objc/objc-act.c \
- $(CONFIG_H) $(TREE_H) $(RTL_H) $(SYSTEM_H) $(EXPR_H) $(TARGET_H) \
- $(C_COMMON_H) $(srcdir)/c-tree.h $(srcdir)/diagnostic.h \
- $(srcdir)/toplev.h $(srcdir)/flags.h $(srcdir)/objc/objc-act.h \
- $(srcdir)/input.h $(srcdir)/function.h $(srcdir)/output.h $(srcdir)/debug.h \
- $(srcdir)/langhooks.h $(LANGHOOKS_DEF_H) gtype-objc.h
- $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/objc \
- -c $(srcdir)/objc/objc-act.c
-
gtype-objc.h : s-gtype ; @true
#
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 018ba04f999..d4ebd6288ab 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -41,6 +41,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "expr.h"
diff --git a/gcc/objc/objc-lang.c b/gcc/objc/objc-lang.c
index 73e6204c43b..3aa901f4470 100644
--- a/gcc/objc/objc-lang.c
+++ b/gcc/objc/objc-lang.c
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "c-tree.h"
#include "c-common.h"
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 9da95e1de72..9aa2e4ae3f8 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -22,6 +22,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "toplev.h"
/* Include insn-config.h before expr.h so that HAVE_conditional_move
@@ -2514,6 +2516,39 @@ expand_unop (mode, unoptab, op0, target, unsignedp)
return target;
}
+ /* Try negating floating point values by flipping the sign bit. */
+ if (unoptab->code == NEG && class == MODE_FLOAT
+ && GET_MODE_BITSIZE (mode) <= 2 * HOST_BITS_PER_WIDE_INT)
+ {
+ const struct real_format *fmt = real_format_for_mode[mode - QFmode];
+ enum machine_mode imode = int_mode_for_mode (mode);
+ int bitpos = (fmt != 0) ? fmt->signbit : -1;
+
+ if (imode != BLKmode && bitpos >= 0 && fmt->has_signed_zero)
+ {
+ HOST_WIDE_INT hi, lo;
+ rtx last = get_last_insn ();
+
+ if (bitpos < HOST_BITS_PER_WIDE_INT)
+ {
+ hi = 0;
+ lo = (HOST_WIDE_INT) 1 << bitpos;
+ }
+ else
+ {
+ hi = (HOST_WIDE_INT) 1 << (bitpos - HOST_BITS_PER_WIDE_INT);
+ lo = 0;
+ }
+ temp = expand_binop (imode, xor_optab,
+ gen_lowpart (imode, op0),
+ immed_double_const (lo, hi, imode),
+ NULL_RTX, 1, OPTAB_LIB_WIDEN);
+ if (temp != 0)
+ return gen_lowpart (mode, temp);
+ delete_insns_since (last);
+ }
+ }
+
/* Now try a library call in this mode. */
if (unoptab->handlers[(int) mode].libfunc)
{
@@ -2626,6 +2661,39 @@ expand_abs (mode, op0, target, result_unsignedp, safe)
if (temp != 0)
return temp;
+ /* For floating point modes, try clearing the sign bit. */
+ if (GET_MODE_CLASS (mode) == MODE_FLOAT
+ && GET_MODE_BITSIZE (mode) <= 2 * HOST_BITS_PER_WIDE_INT)
+ {
+ const struct real_format *fmt = real_format_for_mode[mode - QFmode];
+ enum machine_mode imode = int_mode_for_mode (mode);
+ int bitpos = (fmt != 0) ? fmt->signbit : -1;
+
+ if (imode != BLKmode && bitpos >= 0)
+ {
+ HOST_WIDE_INT hi, lo;
+ rtx last = get_last_insn ();
+
+ if (bitpos < HOST_BITS_PER_WIDE_INT)
+ {
+ hi = 0;
+ lo = (HOST_WIDE_INT) 1 << bitpos;
+ }
+ else
+ {
+ hi = (HOST_WIDE_INT) 1 << (bitpos - HOST_BITS_PER_WIDE_INT);
+ lo = 0;
+ }
+ temp = expand_binop (imode, and_optab,
+ gen_lowpart (imode, op0),
+ immed_double_const (~lo, ~hi, imode),
+ NULL_RTX, 1, OPTAB_LIB_WIDEN);
+ if (temp != 0)
+ return gen_lowpart (mode, temp);
+ delete_insns_since (last);
+ }
+ }
+
/* If we have a MAX insn, we can do this as MAX (x, -x). */
if (smax_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
{
@@ -5164,6 +5232,11 @@ init_optabs ()
one_cmpl_optab = init_optab (NOT);
ffs_optab = init_optab (FFS);
sqrt_optab = init_optab (SQRT);
+ floor_optab = init_optab (UNKNOWN);
+ ceil_optab = init_optab (UNKNOWN);
+ round_optab = init_optab (UNKNOWN);
+ trunc_optab = init_optab (UNKNOWN);
+ nearbyint_optab = init_optab (UNKNOWN);
sin_optab = init_optab (UNKNOWN);
cos_optab = init_optab (UNKNOWN);
exp_optab = init_optab (UNKNOWN);
diff --git a/gcc/optabs.h b/gcc/optabs.h
index fd80d826720..b9d528ee387 100644
--- a/gcc/optabs.h
+++ b/gcc/optabs.h
@@ -135,6 +135,12 @@ enum optab_index
OTI_exp,
/* Natural Logarithm */
OTI_log,
+ /* Rounding functions */
+ OTI_floor,
+ OTI_ceil,
+ OTI_trunc,
+ OTI_round,
+ OTI_nearbyint,
/* Compare insn; two operands. */
OTI_cmp,
@@ -204,6 +210,11 @@ extern GTY(()) optab optab_table[OTI_MAX];
#define cos_optab (optab_table[OTI_cos])
#define exp_optab (optab_table[OTI_exp])
#define log_optab (optab_table[OTI_log])
+#define floor_optab (optab_table[OTI_floor])
+#define ceil_optab (optab_table[OTI_ceil])
+#define trunc_optab (optab_table[OTI_trunc])
+#define round_optab (optab_table[OTI_round])
+#define nearbyint_optab (optab_table[OTI_nearbyint])
#define cmp_optab (optab_table[OTI_cmp])
#define ucmp_optab (optab_table[OTI_ucmp])
diff --git a/gcc/output.h b/gcc/output.h
index 0f089719082..d6c0a050d68 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -26,10 +26,6 @@ extern void compute_alignments PARAMS ((void));
/* Initialize data in final at the beginning of a compilation. */
extern void init_final PARAMS ((const char *));
-/* Called at end of source file,
- to output the block-profiling table for this entire compilation. */
-extern void end_final PARAMS ((const char *));
-
/* Enable APP processing of subsequent output.
Used before the output from an `asm' statement. */
extern void app_enable PARAMS ((void));
@@ -155,9 +151,6 @@ extern void text_section PARAMS ((void));
/* Tell assembler to switch to data section. */
extern void data_section PARAMS ((void));
-/* Tell assembler to make sure its in the data section. */
-extern void force_data_section PARAMS ((void));
-
/* Tell assembler to switch to read-only data section. This is normally
the text section. */
extern void readonly_data_section PARAMS ((void));
@@ -248,9 +241,6 @@ extern int decode_reg_name PARAMS ((const char *));
Use this only for static variables. */
extern void make_var_volatile PARAMS ((tree));
-/* Output alignment directive to align for constant expression EXP. */
-extern void assemble_constant_align PARAMS ((tree));
-
extern void assemble_alias PARAMS ((tree, tree));
extern void default_assemble_visibility PARAMS ((tree, int));
@@ -533,6 +523,8 @@ extern const char *default_strip_name_encoding PARAMS ((const char *));
extern bool default_binds_local_p PARAMS ((tree));
extern bool default_binds_local_p_1 PARAMS ((tree, int));
extern void default_globalize_label PARAMS ((FILE *, const char *));
+extern void default_internal_label PARAMS ((FILE *, const char *, unsigned long));
+extern bool default_valid_pointer_mode PARAMS ((enum machine_mode));
/* Emit data for vtable gc for GNU binutils. */
extern void assemble_vtable_entry PARAMS ((struct rtx_def *, HOST_WIDE_INT));
diff --git a/gcc/params.c b/gcc/params.c
index 72c67bebf3b..b4c7aa5fe76 100644
--- a/gcc/params.c
+++ b/gcc/params.c
@@ -23,6 +23,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "params.h"
#include "toplev.h"
diff --git a/gcc/predict.c b/gcc/predict.c
index 7e581468dec..feeaeaca572 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -30,6 +30,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "tm_p.h"
@@ -1077,7 +1079,7 @@ estimate_loops_at_level (first_loop)
static void
counts_to_freqs ()
{
- HOST_WIDEST_INT count_max = 1;
+ gcov_type count_max = 1;
basic_block bb;
FOR_EACH_BB (bb)
diff --git a/gcc/prefix.c b/gcc/prefix.c
index 06930fee2ab..e2f8a6714da 100644
--- a/gcc/prefix.c
+++ b/gcc/prefix.c
@@ -67,6 +67,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#if defined(_WIN32) && defined(ENABLE_WIN32_REGISTRY)
#include <windows.h>
#endif
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index c01f9185add..f61b09123d1 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -22,6 +22,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
/* We don't want the tree code checking code for the access to the
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index e7c16559e56..d063831f1a2 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -22,6 +22,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "real.h"
#include "ggc.h"
diff --git a/gcc/profile.c b/gcc/profile.c
index a70dc617621..4e6aecd6b64 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -39,36 +39,19 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
edges must be on the spanning tree. We also attempt to place
EDGE_CRITICAL edges on the spanning tree.
- The two auxiliary files generated are <dumpbase>.bb and
- <dumpbase>.bbg. The former contains the BB->linenumber
- mappings, and the latter describes the BB graph.
-
- The BB file contains line numbers for each block. For each basic
- block, a zero count is output (to mark the start of a block), then
- the line numbers of that block are listed. A zero ends the file
- too.
-
- The BBG file contains a count of the blocks, followed by edge
- information, for every edge in the graph. The edge information
- lists the source and target block numbers, and a bit mask
- describing the type of edge.
-
- The BB and BBG file formats are fully described in the gcov
- documentation. */
+ The auxiliary file generated is <dumpbase>.bbg. The format is
+ described in full in gcov-io.h. */
/* ??? Register allocation should use basic block execution counts to
give preference to the most commonly executed blocks. */
-/* ??? The .da files are not safe. Changing the program after creating .da
- files or using different options when compiling with -fbranch-probabilities
- can result the arc data not matching the program. Maybe add instrumented
- arc count to .bbg file? Maybe check whether PFG matches the .bbg file? */
-
/* ??? Should calculate branch probabilities before instrumenting code, since
then we can use arc counts to help decide which arcs to instrument. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
@@ -86,6 +69,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "profile.h"
#include "libfuncs.h"
#include "langhooks.h"
+#include "hashtab.h"
/* Additional information about the edges we need. */
struct edge_info {
@@ -107,6 +91,17 @@ struct bb_info {
gcov_type pred_count;
};
+struct function_list
+{
+ struct function_list *next; /* next function */
+ const char *name; /* function name */
+ unsigned cfg_checksum; /* function checksum */
+ unsigned count_edges; /* number of intrumented edges */
+};
+
+static struct function_list *functions_head = 0;
+static struct function_list **functions_tail = &functions_head;
+
#define EDGE_INFO(e) ((struct edge_info *) (e)->aux)
#define BB_INFO(b) ((struct bb_info *) (b)->aux)
@@ -123,18 +118,15 @@ struct profile_info profile_info;
/* Name and file pointer of the output file for the basic block graph. */
static FILE *bbg_file;
+static char *bbg_file_name;
/* Name and file pointer of the input file for the arc count data. */
static FILE *da_file;
static char *da_file_name;
-/* Pointer of the output file for the basic block/line number map. */
-static FILE *bb_file;
-
-/* Last source file name written to bb_file. */
-
-static char *last_bb_file_name;
+/* The name of the count table. Used by the edge profiling code. */
+static GTY(()) rtx profiler_label;
/* Collect statistics on the performance of this pass for the entire source
file. */
@@ -152,19 +144,19 @@ static int total_num_branches;
/* Forward declarations. */
static void find_spanning_tree PARAMS ((struct edge_list *));
-static void init_edge_profiler PARAMS ((void));
static rtx gen_edge_profiler PARAMS ((int));
static void instrument_edges PARAMS ((struct edge_list *));
-static void output_gcov_string PARAMS ((const char *, long));
static void compute_branch_probabilities PARAMS ((void));
+static hashval_t htab_counts_index_hash PARAMS ((const void *));
+static int htab_counts_index_eq PARAMS ((const void *, const void *));
+static void htab_counts_index_del PARAMS ((void *));
+static void cleanup_counts_index PARAMS ((int));
+static int index_counts_file PARAMS ((void));
static gcov_type * get_exec_counts PARAMS ((void));
-static long compute_checksum PARAMS ((void));
+static unsigned compute_checksum PARAMS ((void));
static basic_block find_group PARAMS ((basic_block));
static void union_groups PARAMS ((basic_block, basic_block));
-/* If nonzero, we need to output a constructor to set up the
- per-object-file data. */
-static int need_func_profiler = 0;
/* Add edge instrumentation code to the entire insn chain.
@@ -194,7 +186,6 @@ instrument_edges (el)
fprintf (rtl_dump_file, "Edge %d to %d instrumented%s\n",
e->src->index, e->dest->index,
EDGE_CRITICAL_P (e) ? " (and split)" : "");
- need_func_profiler = 1;
insert_insn_on_edge (
gen_edge_profiler (total_num_edges_instrumented
+ num_instr_edges++), e);
@@ -213,38 +204,212 @@ instrument_edges (el)
commit_edge_insertions_watch_calls ();
}
+
+struct section_reference
+{
+ long offset;
+ int owns_summary;
+ long *summary;
+};
+
+struct da_index_entry
+{
+ /* We hash by */
+ char *function_name;
+ unsigned section;
+ /* and store */
+ unsigned checksum;
+ unsigned n_offsets;
+ struct section_reference *offsets;
+};
+
+static hashval_t
+htab_counts_index_hash (of)
+ const void *of;
+{
+ const struct da_index_entry *entry = of;
+
+ return htab_hash_string (entry->function_name) ^ entry->section;
+}
-/* Output STRING to bb_file, surrounded by DELIMITER. */
+static int
+htab_counts_index_eq (of1, of2)
+ const void *of1;
+ const void *of2;
+{
+ const struct da_index_entry *entry1 = of1;
+ const struct da_index_entry *entry2 = of2;
+
+ return !strcmp (entry1->function_name, entry2->function_name)
+ && entry1->section == entry2->section;
+}
static void
-output_gcov_string (string, delimiter)
- const char *string;
- long delimiter;
+htab_counts_index_del (what)
+ void *what;
{
- size_t temp;
+ struct da_index_entry *entry = what;
+ unsigned i;
- /* Write a delimiter to indicate that a file name follows. */
- __write_long (delimiter, bb_file, 4);
+ for (i = 0; i < entry->n_offsets; i++)
+ {
+ struct section_reference *act = entry->offsets + i;
+ if (act->owns_summary)
+ free (act->summary);
+ }
+ free (entry->function_name);
+ free (entry->offsets);
+ free (entry);
+}
- /* Write the string. */
- temp = strlen (string) + 1;
- fwrite (string, temp, 1, bb_file);
+static char *counts_file_name;
+static htab_t counts_file_index = NULL;
- /* Append a few zeros, to align the output to a 4 byte boundary. */
- temp = temp & 0x3;
- if (temp)
+static void
+cleanup_counts_index (close_file)
+ int close_file;
+{
+ if (da_file && close_file)
{
- char c[4];
+ fclose (da_file);
+ da_file = NULL;
+ }
+ if (counts_file_name)
+ free (counts_file_name);
+ counts_file_name = NULL;
+ if (counts_file_index)
+ htab_delete (counts_file_index);
+ counts_file_index = NULL;
+}
+
+static int
+index_counts_file ()
+{
+ char *function_name_buffer = NULL;
+ unsigned magic, version, ix, checksum;
+ long *summary;
+
+ if (!da_file)
+ return 0;
+ counts_file_index = htab_create (10, htab_counts_index_hash, htab_counts_index_eq, htab_counts_index_del);
- c[0] = c[1] = c[2] = c[3] = 0;
- fwrite (c, sizeof (char), 4 - temp, bb_file);
+ /* No .da file, no data. */
+ if (!da_file)
+ return 0;
+
+ /* Now index all profile sections. */
+
+ rewind (da_file);
+
+ summary = NULL;
+
+ if (gcov_read_unsigned (da_file, &magic) || magic != GCOV_DATA_MAGIC)
+ {
+ warning ("`%s' is not a gcov data file", da_file_name);
+ goto cleanup;
+ }
+ if (gcov_read_unsigned (da_file, &version) || version != GCOV_VERSION)
+ {
+ char v[4], e[4];
+ magic = GCOV_VERSION;
+
+ for (ix = 4; ix--; magic >>= 8, version >>= 8)
+ {
+ v[ix] = version;
+ e[ix] = magic;
+ }
+ warning ("`%s' is version `%.4s', expected version `%.4s'",
+ da_file_name, v, e);
+ goto cleanup;
}
+
+ while (1)
+ {
+ unsigned tag, length;
+ long offset;
+
+ offset = gcov_save_position (da_file);
+ if (gcov_read_unsigned (da_file, &tag)
+ || gcov_read_unsigned (da_file, &length))
+ {
+ if (feof (da_file))
+ break;
+ corrupt:;
+ warning ("`%s' is corrupted", da_file_name);
+ goto cleanup;
+ }
+ if (tag == GCOV_TAG_FUNCTION)
+ {
+ if (gcov_read_string (da_file, &function_name_buffer, NULL)
+ || gcov_read_unsigned (da_file, &checksum))
+ goto corrupt;
+ continue;
+ }
+ if (tag == GCOV_TAG_PROGRAM_SUMMARY)
+ {
+ if (length != GCOV_SUMMARY_LENGTH)
+ goto corrupt;
- /* Store another delimiter in the .bb file, just to make it easy to find
- the end of the file name. */
- __write_long (delimiter, bb_file, 4);
+ if (summary)
+ *summary = offset;
+ summary = NULL;
+ }
+ else
+ {
+ if (function_name_buffer)
+ {
+ struct da_index_entry **slot, elt;
+ elt.function_name = function_name_buffer;
+ elt.section = tag;
+
+ slot = (struct da_index_entry **)
+ htab_find_slot (counts_file_index, &elt, INSERT);
+ if (*slot)
+ {
+ if ((*slot)->checksum != checksum)
+ {
+ warning ("profile mismatch for `%s'", function_name_buffer);
+ goto cleanup;
+ }
+ (*slot)->n_offsets++;
+ (*slot)->offsets = xrealloc ((*slot)->offsets,
+ sizeof (struct section_reference) * (*slot)->n_offsets);
+ }
+ else
+ {
+ *slot = xmalloc (sizeof (struct da_index_entry));
+ (*slot)->function_name = xstrdup (function_name_buffer);
+ (*slot)->section = tag;
+ (*slot)->checksum = checksum;
+ (*slot)->n_offsets = 1;
+ (*slot)->offsets = xmalloc (sizeof (struct section_reference));
+ }
+ (*slot)->offsets[(*slot)->n_offsets - 1].offset = offset;
+ if (summary)
+ (*slot)->offsets[(*slot)->n_offsets - 1].owns_summary = 0;
+ else
+ {
+ summary = xmalloc (sizeof (long));
+ *summary = -1;
+ (*slot)->offsets[(*slot)->n_offsets - 1].owns_summary = 1;
+ }
+ (*slot)->offsets[(*slot)->n_offsets - 1].summary = summary;
+ }
+ }
+ if (gcov_skip (da_file, length))
+ goto corrupt;
+ }
+
+ free (function_name_buffer);
+
+ return 1;
+
+cleanup:
+ cleanup_counts_index (1);
+ if (function_name_buffer)
+ free (function_name_buffer);
+ return 0;
}
-
/* Computes hybrid profile for all matching entries in da_file.
Sets max_counter_in_program as a side effect. */
@@ -252,23 +417,25 @@ output_gcov_string (string, delimiter)
static gcov_type *
get_exec_counts ()
{
- int num_edges = 0;
+ unsigned num_edges = 0;
basic_block bb;
- int okay = 1, i;
- int mismatch = 0;
gcov_type *profile;
- char *function_name_buffer;
- int function_name_buffer_len;
- gcov_type max_counter_in_run;
- const char *name = IDENTIFIER_POINTER
- (DECL_ASSEMBLER_NAME (current_function_decl));
+ gcov_type max_count;
+ unsigned ix, i, tag, length, num;
+ const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl));
+ struct da_index_entry *entry, what;
+ struct section_reference *act;
+ gcov_type count;
+ struct gcov_summary summ;
profile_info.max_counter_in_program = 0;
profile_info.count_profiles_merged = 0;
/* No .da file, no execution counts. */
if (!da_file)
- return 0;
+ return NULL;
+ if (!counts_file_index)
+ abort ();
/* Count the edges to be (possibly) instrumented. */
@@ -283,124 +450,79 @@ get_exec_counts ()
/* now read and combine all matching profiles. */
profile = xmalloc (sizeof (gcov_type) * num_edges);
- rewind (da_file);
- function_name_buffer_len = strlen (name) + 1;
- function_name_buffer = xmalloc (function_name_buffer_len + 1);
- for (i = 0; i < num_edges; i++)
- profile[i] = 0;
+ for (ix = 0; ix < num_edges; ix++)
+ profile[ix] = 0;
- while (1)
+ what.function_name = (char *) name;
+ what.section = GCOV_TAG_ARC_COUNTS;
+ entry = htab_find (counts_file_index, &what);
+ if (!entry)
{
- long magic, extra_bytes;
- long func_count;
- int i;
+ warning ("No profile for function '%s' found.", name);
+ goto cleanup;
+ }
+
+ if (entry->checksum != profile_info.current_function_cfg_checksum)
+ {
+ warning ("profile mismatch for `%s'", current_function_name);
+ goto cleanup;
+ }
- if (__read_long (&magic, da_file, 4) != 0)
- break;
+ for (i = 0; i < entry->n_offsets; i++)
+ {
+ act = entry->offsets + i;
- if (magic != -123)
+ /* Read arc counters. */
+ max_count = 0;
+ gcov_resync (da_file, act->offset, 0);
+
+ if (gcov_read_unsigned (da_file, &tag)
+ || gcov_read_unsigned (da_file, &length)
+ || tag != GCOV_TAG_ARC_COUNTS)
{
- okay = 0;
- break;
+ /* We have already passed through file, so any error means
+ something is rotten. */
+ abort ();
}
+ num = length / 8;
- if (__read_long (&func_count, da_file, 4) != 0)
+ if (num != num_edges)
{
- okay = 0;
- break;
+ warning ("profile mismatch for `%s'", current_function_name);
+ goto cleanup;
}
-
- if (__read_long (&extra_bytes, da_file, 4) != 0)
+
+ for (ix = 0; ix != num; ix++)
{
- okay = 0;
- break;
+ if (gcov_read_counter (da_file, &count))
+ abort ();
+ if (count > max_count)
+ max_count = count;
+ profile[ix] += count;
}
- fseek (da_file, 4 + 8, SEEK_CUR);
-
- /* read the maximal counter. */
- __read_gcov_type (&max_counter_in_run, da_file, 8);
-
- /* skip the rest of "statistics" emited by __bb_exit_func. */
- fseek (da_file, extra_bytes - (4 + 8 + 8), SEEK_CUR);
-
- for (i = 0; i < func_count; i++)
+ /* Read program summary. */
+ if (*act->summary != -1)
{
- long arc_count;
- long chksum;
- int j;
-
- if (__read_gcov_string
- (function_name_buffer, function_name_buffer_len, da_file,
- -1) != 0)
- {
- okay = 0;
- break;
- }
-
- if (__read_long (&chksum, da_file, 4) != 0)
- {
- okay = 0;
- break;
- }
-
- if (__read_long (&arc_count, da_file, 4) != 0)
- {
- okay = 0;
- break;
- }
-
- if (strcmp (function_name_buffer, name) != 0)
- {
- /* skip */
- if (fseek (da_file, arc_count * 8, SEEK_CUR) < 0)
- {
- okay = 0;
- break;
- }
- }
- else if (arc_count != num_edges
- || chksum != profile_info.current_function_cfg_checksum)
- okay = 0, mismatch = 1;
- else
- {
- gcov_type tmp;
-
- profile_info.max_counter_in_program += max_counter_in_run;
- profile_info.count_profiles_merged++;
-
- for (j = 0; j < arc_count; j++)
- if (__read_gcov_type (&tmp, da_file, 8) != 0)
- {
- okay = 0;
- break;
- }
- else
- {
- profile[j] += tmp;
- }
- }
+ gcov_resync (da_file, *act->summary, 0);
+ if (gcov_read_unsigned (da_file, &tag)
+ || gcov_read_unsigned (da_file, &length)
+ || tag != GCOV_TAG_PROGRAM_SUMMARY
+ || gcov_read_summary (da_file, &summ))
+ abort ();
+ profile_info.count_profiles_merged += summ.runs;
+ profile_info.max_counter_in_program += summ.arc_sum_max;
}
-
- if (!okay)
- break;
-
- }
-
- free (function_name_buffer);
-
- if (!okay)
- {
- if (mismatch)
- error
- ("Profile does not match flowgraph of function %s (out of date?)",
- current_function_name);
else
- error (".da file corrupted");
- free (profile);
- return 0;
+ summ.runs = 0;
+ if (!summ.runs)
+ {
+ profile_info.count_profiles_merged++;
+ profile_info.max_counter_in_program += max_count;
+ }
}
+
if (rtl_dump_file)
{
fprintf(rtl_dump_file, "Merged %i profiles with maximal count %i.\n",
@@ -409,6 +531,11 @@ get_exec_counts ()
}
return profile;
+
+cleanup:;
+ free (profile);
+ cleanup_counts_index (1);
+ return NULL;
}
@@ -669,10 +796,11 @@ compute_branch_probabilities ()
num_branches++;
}
}
- /* Otherwise distribute the probabilities evenly so we get sane sum.
- Use simple heuristics that if there are normal edges, give all abnormals
- frequency of 0, otherwise distribute the frequency over abnormals
- (this is the case of noreturn calls). */
+ /* Otherwise distribute the probabilities evenly so we get sane
+ sum. Use simple heuristics that if there are normal edges,
+ give all abnormals frequency of 0, otherwise distribute the
+ frequency over abnormals (this is the case of noreturn
+ calls). */
else
{
for (e = bb->succ; e; e = e->succ_next)
@@ -725,30 +853,43 @@ compute_branch_probabilities ()
free (exec_counts);
}
-/* Compute checksum for the current function. */
+/* Compute checksum for the current function. We generate a CRC32. */
-#define CHSUM_HASH 500000003
-#define CHSUM_SHIFT 2
-
-static long
+static unsigned
compute_checksum ()
{
- long chsum = 0;
+ unsigned chksum = 0;
basic_block bb;
-
+
FOR_EACH_BB (bb)
{
- edge e;
-
- for (e = bb->succ; e; e = e->succ_next)
+ edge e = NULL;
+
+ do
{
- chsum = ((chsum << CHSUM_SHIFT) + (BB_TO_GCOV_INDEX (e->dest) + 1)) % CHSUM_HASH;
- }
+ unsigned value = BB_TO_GCOV_INDEX (e ? e->dest : bb);
+ unsigned ix;
+
+ /* No need to use all bits in value identically, nearly all
+ functions have less than 256 blocks. */
+ value ^= value << 16;
+ value ^= value << 8;
+
+ for (ix = 8; ix--; value <<= 1)
+ {
+ unsigned feedback;
- chsum = (chsum << CHSUM_SHIFT) % CHSUM_HASH;
+ feedback = (value ^ chksum) & 0x80000000 ? 0x04c11db7 : 0;
+ chksum <<= 1;
+ chksum ^= feedback;
+ }
+
+ e = e ? e->succ_next : bb->succ;
+ }
+ while (e);
}
- return chsum;
+ return chksum;
}
/* Instrument and/or analyze program behavior based on program flow graph.
@@ -775,18 +916,14 @@ branch_prob ()
int num_edges, ignored_edges;
struct edge_list *el;
const char *name = IDENTIFIER_POINTER
- (DECL_ASSEMBLER_NAME (current_function_decl));
+ (DECL_ASSEMBLER_NAME (current_function_decl));
profile_info.current_function_cfg_checksum = compute_checksum ();
if (rtl_dump_file)
- fprintf (rtl_dump_file, "CFG checksum is %ld\n",
+ fprintf (rtl_dump_file, "CFG checksum is %u\n",
profile_info.current_function_cfg_checksum);
- /* Start of a function. */
- if (flag_test_coverage)
- output_gcov_string (name, (long) -2);
-
total_num_times_called++;
flow_call_edges_add (NULL);
@@ -895,70 +1032,6 @@ branch_prob ()
verify_flow_info ();
#endif
- /* Output line number information about each basic block for
- GCOV utility. */
- if (flag_test_coverage)
- {
- FOR_EACH_BB (bb)
- {
- rtx insn = bb->head;
- static int ignore_next_note = 0;
-
- /* We are looking for line number notes. Search backward before
- basic block to find correct ones. */
- insn = prev_nonnote_insn (insn);
- if (!insn)
- insn = get_insns ();
- else
- insn = NEXT_INSN (insn);
-
- /* Output a zero to the .bb file to indicate that a new
- block list is starting. */
- __write_long (0, bb_file, 4);
-
- while (insn != bb->end)
- {
- if (GET_CODE (insn) == NOTE)
- {
- /* Must ignore the line number notes that immediately
- follow the end of an inline function to avoid counting
- it twice. There is a note before the call, and one
- after the call. */
- if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_REPEATED_LINE_NUMBER)
- ignore_next_note = 1;
- else if (NOTE_LINE_NUMBER (insn) > 0)
- {
- if (ignore_next_note)
- ignore_next_note = 0;
- else
- {
- /* If this is a new source file, then output the
- file's name to the .bb file. */
- if (! last_bb_file_name
- || strcmp (NOTE_SOURCE_FILE (insn),
- last_bb_file_name))
- {
- if (last_bb_file_name)
- free (last_bb_file_name);
- last_bb_file_name
- = xstrdup (NOTE_SOURCE_FILE (insn));
- output_gcov_string (NOTE_SOURCE_FILE (insn),
- (long)-1);
- }
- /* Output the line number to the .bb file. Must be
- done after the output_bb_profile_data() call, and
- after the file name is written, to ensure that it
- is correctly handled by gcov. */
- __write_long (NOTE_LINE_NUMBER (insn), bb_file, 4);
- }
- }
- }
- insn = NEXT_INSN (insn);
- }
- }
- __write_long (0, bb_file, 4);
- }
-
/* Create spanning tree from basic block graph, mark each edge that is
on the spanning tree. We insert as many abnormal and critical edges
as possible to minimize number of edge splits necessary. */
@@ -995,56 +1068,140 @@ branch_prob ()
edge output the source and target basic block numbers.
NOTE: The format of this file must be compatible with gcov. */
- if (flag_test_coverage)
+ if (flag_test_coverage && bbg_file)
{
- int flag_bits;
-
- __write_gcov_string (name, strlen (name), bbg_file, -1);
-
- /* write checksum. */
- __write_long (profile_info.current_function_cfg_checksum, bbg_file, 4);
-
- /* The plus 2 stands for entry and exit block. */
- __write_long (n_basic_blocks + 2, bbg_file, 4);
- __write_long (num_edges - ignored_edges + 1, bbg_file, 4);
-
+ long offset;
+
+ /* Announce function */
+ if (gcov_write_unsigned (bbg_file, GCOV_TAG_FUNCTION)
+ || !(offset = gcov_reserve_length (bbg_file))
+ || gcov_write_string (bbg_file, name,
+ strlen (name))
+ || gcov_write_unsigned (bbg_file,
+ profile_info.current_function_cfg_checksum)
+ || gcov_write_length (bbg_file, offset))
+ goto bbg_error;
+
+ /* Basic block flags */
+ if (gcov_write_unsigned (bbg_file, GCOV_TAG_BLOCKS)
+ || !(offset = gcov_reserve_length (bbg_file)))
+ goto bbg_error;
+ for (i = 0; i != n_basic_blocks + 2; i++)
+ if (gcov_write_unsigned (bbg_file, 0))
+ goto bbg_error;
+ if (gcov_write_length (bbg_file, offset))
+ goto bbg_error;
+
+ /* Arcs */
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb)
{
edge e;
- long count = 0;
- for (e = bb->succ; e; e = e->succ_next)
- if (!EDGE_INFO (e)->ignore)
- count++;
- __write_long (count, bbg_file, 4);
+ if (gcov_write_unsigned (bbg_file, GCOV_TAG_ARCS)
+ || !(offset = gcov_reserve_length (bbg_file))
+ || gcov_write_unsigned (bbg_file, BB_TO_GCOV_INDEX (bb)))
+ goto bbg_error;
for (e = bb->succ; e; e = e->succ_next)
{
struct edge_info *i = EDGE_INFO (e);
if (!i->ignore)
{
- flag_bits = 0;
+ unsigned flag_bits = 0;
+
if (i->on_tree)
- flag_bits |= 0x1;
+ flag_bits |= GCOV_ARC_ON_TREE;
if (e->flags & EDGE_FAKE)
- flag_bits |= 0x2;
+ flag_bits |= GCOV_ARC_FAKE;
if (e->flags & EDGE_FALLTHRU)
- flag_bits |= 0x4;
+ flag_bits |= GCOV_ARC_FALLTHROUGH;
- __write_long (BB_TO_GCOV_INDEX (e->dest), bbg_file, 4);
- __write_long (flag_bits, bbg_file, 4);
+ if (gcov_write_unsigned (bbg_file,
+ BB_TO_GCOV_INDEX (e->dest))
+ || gcov_write_unsigned (bbg_file, flag_bits))
+ goto bbg_error;
}
}
+ if (gcov_write_length (bbg_file, offset))
+ goto bbg_error;
}
- /* Emit fake loopback edge for EXIT block to maintain compatibility with
- old gcov format. */
- __write_long (1, bbg_file, 4);
- __write_long (0, bbg_file, 4);
- __write_long (0x1, bbg_file, 4);
-
- /* Emit a -1 to separate the list of all edges from the list of
- loop back edges that follows. */
- __write_long (-1, bbg_file, 4);
+
+ /* Output line number information about each basic block for
+ GCOV utility. */
+ {
+ char const *prev_file_name = NULL;
+
+ FOR_EACH_BB (bb)
+ {
+ rtx insn = bb->head;
+ int ignore_next_note = 0;
+
+ offset = 0;
+
+ /* We are looking for line number notes. Search backward
+ before basic block to find correct ones. */
+ insn = prev_nonnote_insn (insn);
+ if (!insn)
+ insn = get_insns ();
+ else
+ insn = NEXT_INSN (insn);
+
+ while (insn != bb->end)
+ {
+ if (GET_CODE (insn) == NOTE)
+ {
+ /* Must ignore the line number notes that immediately
+ follow the end of an inline function to avoid counting
+ it twice. There is a note before the call, and one
+ after the call. */
+ if (NOTE_LINE_NUMBER (insn)
+ == NOTE_INSN_REPEATED_LINE_NUMBER)
+ ignore_next_note = 1;
+ else if (NOTE_LINE_NUMBER (insn) <= 0)
+ /*NOP*/;
+ else if (ignore_next_note)
+ ignore_next_note = 0;
+ else
+ {
+ if (offset)
+ /*NOP*/;
+ else if (gcov_write_unsigned (bbg_file, GCOV_TAG_LINES)
+ || !(offset = gcov_reserve_length (bbg_file))
+ || gcov_write_unsigned (bbg_file,
+ BB_TO_GCOV_INDEX (bb)))
+ goto bbg_error;
+ /* If this is a new source file, then output
+ the file's name to the .bb file. */
+ if (!prev_file_name
+ || strcmp (NOTE_SOURCE_FILE (insn),
+ prev_file_name))
+ {
+ prev_file_name = NOTE_SOURCE_FILE (insn);
+ if (gcov_write_unsigned (bbg_file, 0)
+ || gcov_write_string (bbg_file, prev_file_name,
+ strlen (prev_file_name)))
+ goto bbg_error;
+ }
+ if (gcov_write_unsigned (bbg_file, NOTE_LINE_NUMBER (insn)))
+ goto bbg_error;
+ }
+ }
+ insn = NEXT_INSN (insn);
+ }
+ if (offset)
+ {
+ if (gcov_write_unsigned (bbg_file, 0)
+ || gcov_write_string (bbg_file, NULL, 0)
+ || gcov_write_length (bbg_file, offset))
+ {
+ bbg_error:;
+ warning ("error writing `%s'", bbg_file_name);
+ fclose (bbg_file);
+ bbg_file = NULL;
+ }
+ }
+ }
+ }
}
if (flag_branch_probabilities)
@@ -1052,10 +1209,23 @@ branch_prob ()
/* For each edge not on the spanning tree, add counting code as rtl. */
- if (profile_arc_flag)
+ if (cfun->arc_profile && profile_arc_flag)
{
+ struct function_list *item;
+
instrument_edges (el);
allocate_reg_info (max_reg_num (), FALSE, FALSE);
+
+ /* ??? Probably should re-use the existing struct function. */
+ item = xmalloc (sizeof (struct function_list));
+
+ *functions_tail = item;
+ functions_tail = &item->next;
+
+ item->next = 0;
+ item->name = xstrdup (name);
+ item->cfg_checksum = profile_info.current_function_cfg_checksum;
+ item->count_edges = profile_info.count_edges_instrumented_now;
}
remove_fake_edges ();
@@ -1194,30 +1364,25 @@ init_branch_prob (filename)
if (flag_test_coverage)
{
- char *data_file, *bbg_file_name;
-
- /* Open an output file for the basic block/line number map. */
- data_file = (char *) alloca (len + 4);
- strcpy (data_file, filename);
- strcat (data_file, ".bb");
- if ((bb_file = fopen (data_file, "wb")) == 0)
- fatal_io_error ("can't open %s", data_file);
-
- /* Open an output file for the program flow graph. */
- bbg_file_name = (char *) alloca (len + 5);
+ /* Open the bbg output file. */
+ bbg_file_name = (char *) xmalloc (len + strlen (GCOV_GRAPH_SUFFIX) + 1);
strcpy (bbg_file_name, filename);
- strcat (bbg_file_name, ".bbg");
- if ((bbg_file = fopen (bbg_file_name, "wb")) == 0)
- fatal_io_error ("can't open %s", bbg_file_name);
+ strcat (bbg_file_name, GCOV_GRAPH_SUFFIX);
+ bbg_file = fopen (bbg_file_name, "wb");
+ if (!bbg_file)
+ fatal_io_error ("cannot open %s", bbg_file_name);
- /* Initialize to zero, to ensure that the first file name will be
- written to the .bb file. */
- last_bb_file_name = 0;
+ if (gcov_write_unsigned (bbg_file, GCOV_GRAPH_MAGIC)
+ || gcov_write_unsigned (bbg_file, GCOV_VERSION))
+ {
+ fclose (bbg_file);
+ fatal_io_error ("cannot write `%s'", bbg_file_name);
+ }
}
- da_file_name = (char *) xmalloc (len + 4);
+ da_file_name = (char *) xmalloc (len + strlen (GCOV_DATA_SUFFIX) + 1);
strcpy (da_file_name, filename);
- strcat (da_file_name, ".da");
+ strcat (da_file_name, GCOV_DATA_SUFFIX);
if (flag_branch_probabilities)
{
@@ -1225,11 +1390,21 @@ init_branch_prob (filename)
if (!da_file)
warning ("file %s not found, execution counts assumed to be zero",
da_file_name);
+ if (counts_file_index && strcmp (da_file_name, counts_file_name))
+ cleanup_counts_index (0);
+ if (index_counts_file ())
+ counts_file_name = xstrdup (da_file_name);
}
if (profile_arc_flag)
- init_edge_profiler ();
-
+ {
+ /* Generate and save a copy of this so it can be shared. */
+ char buf[20];
+
+ ASM_GENERATE_INTERNAL_LABEL (buf, "LPBX", 2);
+ profiler_label = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf));
+ }
+
total_num_blocks = 0;
total_num_edges = 0;
total_num_edges_ignored = 0;
@@ -1251,12 +1426,32 @@ end_branch_prob ()
{
if (flag_test_coverage)
{
- fclose (bb_file);
- fclose (bbg_file);
- unlink (da_file_name);
+ if (bbg_file)
+ {
+#if __GNUC__ && !CROSS_COMPILE && SUPPORTS_WEAK
+ /* If __gcov_init has a value in the compiler, it means we
+ are instrumenting ourselves. We should not remove the
+ counts file, because we might be recompiling
+ ourselves. The .da files are all removed during copying
+ the stage1 files. */
+ extern void __gcov_init (void *)
+ __attribute__ ((weak));
+
+ if (!__gcov_init)
+ unlink (da_file_name);
+#else
+ unlink (da_file_name);
+#endif
+ fclose (bbg_file);
+ }
+ else
+ {
+ unlink (bbg_file_name);
+ unlink (da_file_name);
+ }
}
- if (flag_branch_probabilities && da_file)
+ if (da_file)
fclose (da_file);
if (rtl_dump_file)
@@ -1292,124 +1487,242 @@ end_branch_prob ()
}
}
}
-
-/* The label used by the edge profiling code. */
-
-static GTY(()) rtx profiler_label;
-
-/* Initialize the profiler_label. */
-
-static void
-init_edge_profiler ()
-{
- /* Generate and save a copy of this so it can be shared. */
- char buf[20];
- ASM_GENERATE_INTERNAL_LABEL (buf, "LPBX", 2);
- profiler_label = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf));
-}
-
-/* Output instructions as RTL to increment the edge execution count. */
-
-static rtx
-gen_edge_profiler (edgeno)
- int edgeno;
-{
- enum machine_mode mode = mode_for_size (GCOV_TYPE_SIZE, MODE_INT, 0);
- rtx mem_ref, tmp;
- rtx sequence;
-
- start_sequence ();
-
- tmp = force_reg (Pmode, profiler_label);
- tmp = plus_constant (tmp, GCOV_TYPE_SIZE / BITS_PER_UNIT * edgeno);
- mem_ref = validize_mem (gen_rtx_MEM (mode, tmp));
-
- set_mem_alias_set (mem_ref, new_alias_set ());
-
- tmp = expand_simple_binop (mode, PLUS, mem_ref, const1_rtx,
- mem_ref, 0, OPTAB_WIDEN);
-
- if (tmp != mem_ref)
- emit_move_insn (copy_rtx (mem_ref), tmp);
-
- sequence = get_insns ();
- end_sequence ();
- return sequence;
-}
-/* Output code for a constructor that will invoke __bb_init_func, if
- this has not already been done. */
+/* Write out the structure which libgcc uses to locate all the arc
+ counters. The structures used here must match those defined in
+ gcov-io.h. Write out the constructor to call __gcov_init. */
void
-output_func_start_profiler ()
+create_profiler ()
{
- tree fnname, fndecl;
- char *name;
- char buf[20];
- const char *cfnname;
- rtx table_address;
- enum machine_mode mode = mode_for_size (GCOV_TYPE_SIZE, MODE_INT, 0);
+ tree fields, field, value = NULL_TREE;
+ tree ginfo_type;
+ tree string_type;
+ tree gcov_type, gcov_ptr_type;
+ char name[20];
+ char *ctor_name;
+ tree structure, ctor;
+ rtx structure_address;
int save_flag_inline_functions = flag_inline_functions;
- /* It's either already been output, or we don't need it because we're
- not doing profile-edges. */
- if (! need_func_profiler)
+ if (!profile_info.count_instrumented_edges)
return;
+
+ string_type = build_pointer_type
+ (build_qualified_type (char_type_node, TYPE_QUAL_CONST));
+ gcov_type = make_signed_type (GCOV_TYPE_SIZE);
+ gcov_ptr_type
+ = build_pointer_type (build_qualified_type
+ (gcov_type, TYPE_QUAL_CONST));
+
+ ginfo_type = (*lang_hooks.types.make_type) (RECORD_TYPE);
+
- need_func_profiler = 0;
-
- /* Synthesize a constructor function to invoke __bb_init_func with a
- pointer to this object file's profile block. */
-
- /* Try and make a unique name given the "file function name".
-
- And no, I don't like this either. */
-
- fnname = get_file_function_name ('I');
- cfnname = IDENTIFIER_POINTER (fnname);
- name = concat (cfnname, "GCOV", NULL);
- fnname = get_identifier (name);
- free (name);
+ /* Version ident */
+ fields = build_decl (FIELD_DECL, NULL_TREE, long_unsigned_type_node);
+ value = tree_cons (fields, convert (long_unsigned_type_node, build_int_2
+ (GCOV_VERSION, 0)), value);
+
+ /* NULL */
+ field = build_decl (FIELD_DECL, NULL_TREE, build_pointer_type
+ (build_qualified_type
+ (ginfo_type, TYPE_QUAL_CONST)));
+ TREE_CHAIN (field) = fields;
+ fields = field;
+ value = tree_cons (fields, null_pointer_node, value);
+
+ /* Filename */
+ {
+ tree filename_string;
+ char *filename;
+ int filename_len;
+
+ filename = getpwd ();
+ filename = (filename && da_file_name[0] != '/'
+ ? concat (filename, "/", da_file_name, NULL)
+ : da_file_name);
+ filename_len = strlen (filename);
+ filename_string = build_string (filename_len + 1, filename);
+ if (filename != da_file_name)
+ free (filename);
+ TREE_TYPE (filename_string) = build_array_type
+ (char_type_node, build_index_type
+ (build_int_2 (filename_len, 0)));
+
+ field = build_decl (FIELD_DECL, NULL_TREE, string_type);
+ TREE_CHAIN (field) = fields;
+ fields = field;
+ value = tree_cons (fields, build1 (ADDR_EXPR, string_type,
+ filename_string), value);
+ }
+
+ /* Workspace */
+ field = build_decl (FIELD_DECL, NULL_TREE, long_integer_type_node);
+ TREE_CHAIN (field) = fields;
+ fields = field;
+ value = tree_cons (fields,
+ convert (long_integer_type_node, integer_zero_node),
+ value);
+
+ /* function_info table */
+ {
+ struct function_list *item;
+ int num_nodes = 0;
+ tree array_value = NULL_TREE;
+ tree finfo_type, finfo_ptr_type;
+ tree name, checksum, arcs;
+
+ finfo_type = (*lang_hooks.types.make_type) (RECORD_TYPE);
+ name = build_decl (FIELD_DECL, NULL_TREE, string_type);
+ checksum = build_decl (FIELD_DECL, NULL_TREE, unsigned_type_node);
+ TREE_CHAIN (checksum) = name;
+ arcs = build_decl (FIELD_DECL, NULL_TREE, unsigned_type_node);
+ TREE_CHAIN (arcs) = checksum;
+ finish_builtin_struct (finfo_type, "__function_info",
+ arcs, NULL_TREE);
+ finfo_ptr_type = build_pointer_type
+ (build_qualified_type (finfo_type, TYPE_QUAL_CONST));
+
+ for (item = functions_head; item != 0; item = item->next, num_nodes++)
+ {
+ size_t name_len = strlen (item->name);
+ tree finfo_value = NULL_TREE;
+ tree fname = build_string (name_len + 1, item->name);
+
+ TREE_TYPE (fname) = build_array_type
+ (char_type_node, build_index_type (build_int_2 (name_len, 0)));
+ finfo_value = tree_cons (name, build1
+ (ADDR_EXPR, string_type,
+ fname), finfo_value);
+ finfo_value = tree_cons (checksum, convert
+ (unsigned_type_node,
+ build_int_2 (item->cfg_checksum, 0)),
+ finfo_value);
+ finfo_value = tree_cons (arcs, convert
+ (unsigned_type_node,
+ build_int_2 (item->count_edges, 0)),
+ finfo_value);
+ array_value = tree_cons (NULL_TREE, build
+ (CONSTRUCTOR, finfo_type, NULL_TREE,
+ nreverse (finfo_value)), array_value);
+ }
+
+ /* Create constructor for array. */
+ if (num_nodes)
+ {
+ tree array_type;
+
+ array_type = build_array_type (finfo_type, build_index_type
+ (build_int_2 (num_nodes - 1, 0)));
+ array_value = build (CONSTRUCTOR, array_type,
+ NULL_TREE, nreverse (array_value));
+ array_value = build1
+ (ADDR_EXPR, finfo_ptr_type, array_value);
+ }
+ else
+ array_value = null_pointer_node;
+
+ field = build_decl (FIELD_DECL, NULL_TREE, finfo_ptr_type);
+ TREE_CHAIN (field) = fields;
+ fields = field;
+ value = tree_cons (fields, array_value, value);
+
+ /* number of functions */
+ field = build_decl (FIELD_DECL, NULL_TREE, unsigned_type_node);
+ TREE_CHAIN (field) = fields;
+ fields = field;
+ value = tree_cons (fields, convert (unsigned_type_node, build_int_2
+ (num_nodes, 0)), value);
+ }
+
+ /* arc count table */
+ {
+ tree counts_table = null_pointer_node;
+
+ if (profile_info.count_instrumented_edges)
+ {
+ tree gcov_type_array_type
+ = build_array_type (gcov_type, build_index_type
+ (build_int_2 (profile_info.
+ count_instrumented_edges - 1, 0)));
+ /* No values. */
+ counts_table
+ = build (VAR_DECL, gcov_type_array_type, NULL_TREE, NULL_TREE);
+ TREE_STATIC (counts_table) = 1;
+ DECL_NAME (counts_table) = get_identifier (XSTR (profiler_label, 0));
+ assemble_variable (counts_table, 0, 0, 0);
+ counts_table = build1 (ADDR_EXPR, gcov_ptr_type, counts_table);
+ }
+
+ field = build_decl (FIELD_DECL, NULL_TREE, gcov_ptr_type);
+ TREE_CHAIN (field) = fields;
+ fields = field;
+ value = tree_cons (fields, counts_table, value);
+ }
+
+ /* number of arc counts */
+ field = build_decl (FIELD_DECL, NULL_TREE, unsigned_type_node);
+ TREE_CHAIN (field) = fields;
+ fields = field;
+ value = tree_cons (fields, convert
+ (unsigned_type_node,
+ build_int_2 (profile_info
+ .count_instrumented_edges, 0)),
+ value);
+
+ finish_builtin_struct (ginfo_type, "__gcov_info", fields, NULL_TREE);
+ structure = build (VAR_DECL, ginfo_type, NULL_TREE, NULL_TREE);
+ DECL_INITIAL (structure)
+ = build (CONSTRUCTOR, ginfo_type, NULL_TREE, nreverse (value));
+ TREE_STATIC (structure) = 1;
+ ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 0);
+ DECL_NAME (structure) = get_identifier (name);
+
+ /* Build structure. */
+ assemble_variable (structure, 0, 0, 0);
- fndecl = build_decl (FUNCTION_DECL, fnname,
- build_function_type (void_type_node, NULL_TREE));
- DECL_EXTERNAL (fndecl) = 0;
+ /* Build the constructor function to invoke __gcov_init. */
+ ctor_name = concat (IDENTIFIER_POINTER (get_file_function_name ('I')),
+ "_GCOV", NULL);
+ ctor = build_decl (FUNCTION_DECL, get_identifier (ctor_name),
+ build_function_type (void_type_node, NULL_TREE));
+ free (ctor_name);
+ DECL_EXTERNAL (ctor) = 0;
/* It can be a static function as long as collect2 does not have
to scan the object file to find its ctor/dtor routine. */
- TREE_PUBLIC (fndecl) = ! targetm.have_ctors_dtors;
-
- TREE_USED (fndecl) = 1;
-
- DECL_RESULT (fndecl) = build_decl (RESULT_DECL, NULL_TREE, void_type_node);
-
- fndecl = (*lang_hooks.decls.pushdecl) (fndecl);
- rest_of_decl_compilation (fndecl, 0, 1, 0);
- announce_function (fndecl);
- current_function_decl = fndecl;
- DECL_INITIAL (fndecl) = error_mark_node;
- make_decl_rtl (fndecl, NULL);
- init_function_start (fndecl, input_filename, lineno);
+ TREE_PUBLIC (ctor) = ! targetm.have_ctors_dtors;
+ TREE_USED (ctor) = 1;
+ DECL_RESULT (ctor) = build_decl (RESULT_DECL, NULL_TREE, void_type_node);
+
+ ctor = (*lang_hooks.decls.pushdecl) (ctor);
+ rest_of_decl_compilation (ctor, 0, 1, 0);
+ announce_function (ctor);
+ current_function_decl = ctor;
+ DECL_INITIAL (ctor) = error_mark_node;
+ make_decl_rtl (ctor, NULL);
+ init_function_start (ctor, input_filename, lineno);
(*lang_hooks.decls.pushlevel) (0);
- expand_function_start (fndecl, 0);
+ expand_function_start (ctor, 0);
cfun->arc_profile = 0;
- /* Actually generate the code to call __bb_init_func. */
- ASM_GENERATE_INTERNAL_LABEL (buf, "LPBX", 0);
- table_address = force_reg (Pmode,
- gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf)));
- emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__bb_init_func"), LCT_NORMAL,
- mode, 1, table_address, Pmode);
+ /* Actually generate the code to call __gcov_init. */
+ structure_address = force_reg (Pmode, gen_rtx_SYMBOL_REF
+ (Pmode, IDENTIFIER_POINTER
+ (DECL_NAME (structure))));
+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__gcov_init"),
+ LCT_NORMAL, VOIDmode, 1,
+ structure_address, Pmode);
expand_function_end (input_filename, lineno, 0);
(*lang_hooks.decls.poplevel) (1, 0, 1);
- /* Since fndecl isn't in the list of globals, it would never be emitted
+ /* Since ctor isn't in the list of globals, it would never be emitted
when it's considered to be 'safe' for inlining, so turn off
flag_inline_functions. */
flag_inline_functions = 0;
- rest_of_compilation (fndecl);
+ rest_of_compilation (ctor);
/* Reset flag_inline_functions to its original value. */
flag_inline_functions = save_flag_inline_functions;
@@ -1419,8 +1732,37 @@ output_func_start_profiler ()
current_function_decl = NULL_TREE;
if (targetm.have_ctors_dtors)
- (* targetm.asm_out.constructor) (XEXP (DECL_RTL (fndecl), 0),
+ (* targetm.asm_out.constructor) (XEXP (DECL_RTL (ctor), 0),
DEFAULT_INIT_PRIORITY);
}
+
+/* Output instructions as RTL to increment the edge execution count. */
+
+static rtx
+gen_edge_profiler (edgeno)
+ int edgeno;
+{
+ enum machine_mode mode = mode_for_size (GCOV_TYPE_SIZE, MODE_INT, 0);
+ rtx mem_ref, tmp;
+ rtx sequence;
+
+ start_sequence ();
+
+ tmp = force_reg (Pmode, profiler_label);
+ tmp = plus_constant (tmp, GCOV_TYPE_SIZE / BITS_PER_UNIT * edgeno);
+ mem_ref = validize_mem (gen_rtx_MEM (mode, tmp));
+
+ set_mem_alias_set (mem_ref, new_alias_set ());
+
+ tmp = expand_simple_binop (mode, PLUS, mem_ref, const1_rtx,
+ mem_ref, 0, OPTAB_WIDEN);
+
+ if (tmp != mem_ref)
+ emit_move_insn (copy_rtx (mem_ref), tmp);
+
+ sequence = get_insns ();
+ end_sequence ();
+ return sequence;
+}
#include "gt-profile.h"
diff --git a/gcc/profile.h b/gcc/profile.h
index 609b0d37e66..4b7ac56d1e4 100644
--- a/gcc/profile.h
+++ b/gcc/profile.h
@@ -36,7 +36,7 @@ struct profile_info
/* Checksum of the cfg. Used for 'identification' of code.
Used by final. */
- long current_function_cfg_checksum;
+ unsigned current_function_cfg_checksum;
/* Max. value of counter in program corresponding to the profile data
for the current function. */
diff --git a/gcc/protoize.c b/gcc/protoize.c
index e039d6d4775..ce51ba26f4a 100644
--- a/gcc/protoize.c
+++ b/gcc/protoize.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "intl.h"
#include "cppdefault.h"
diff --git a/gcc/ra-build.c b/gcc/ra-build.c
index db2979a0120..dd1b8845e03 100644
--- a/gcc/ra-build.c
+++ b/gcc/ra-build.c
@@ -20,6 +20,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tm_p.h"
#include "insn-config.h"
diff --git a/gcc/ra-colorize.c b/gcc/ra-colorize.c
index eecea504f18..e7af3001fa2 100644
--- a/gcc/ra-colorize.c
+++ b/gcc/ra-colorize.c
@@ -20,6 +20,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tm_p.h"
#include "function.h"
@@ -1285,7 +1287,6 @@ colorize_one_web (web, hard)
int c = -1;
int bestc = -1;
int neighbor_needs= 0;
- struct web *fat_neighbor = NULL;
struct web *fats_parent = NULL;
int num_fat = 0;
int long_blocks = 0;
@@ -1318,7 +1319,6 @@ colorize_one_web (web, hard)
&& w->add_hardregs >= neighbor_needs)
{
neighbor_needs = w->add_hardregs;
- fat_neighbor = w;
fats_parent = ptarget;
num_fat++;
}
@@ -1669,9 +1669,7 @@ assign_colors ()
while (WEBS(SELECT))
{
- struct web *web;
d = pop_list (&WEBS(SELECT));
- web = DLIST_WEB (d);
colorize_one_web (DLIST_WEB (d), 1);
}
diff --git a/gcc/ra-debug.c b/gcc/ra-debug.c
index 8daa63d0456..ed5b4ee9148 100644
--- a/gcc/ra-debug.c
+++ b/gcc/ra-debug.c
@@ -20,6 +20,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "insn-config.h"
#include "recog.h"
diff --git a/gcc/ra-rewrite.c b/gcc/ra-rewrite.c
index 61645e22a1d..9071c8fa56e 100644
--- a/gcc/ra-rewrite.c
+++ b/gcc/ra-rewrite.c
@@ -20,6 +20,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tm_p.h"
#include "function.h"
diff --git a/gcc/ra.c b/gcc/ra.c
index ab52b422471..9dd5d4ad77a 100644
--- a/gcc/ra.c
+++ b/gcc/ra.c
@@ -20,6 +20,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tm_p.h"
#include "insn-config.h"
diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c
index 5efd5dc9a20..3869f70dab3 100644
--- a/gcc/read-rtl.c
+++ b/gcc/read-rtl.c
@@ -19,8 +19,10 @@ 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 "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "obstack.h"
#include "hashtab.h"
diff --git a/gcc/real.c b/gcc/real.c
index d9a4b801e3d..1598254c993 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -23,6 +23,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "toplev.h"
#include "real.h"
@@ -2721,6 +2723,7 @@ const struct real_format ieee_single_format =
24,
-125,
128,
+ 31,
true,
true,
true,
@@ -2914,6 +2917,7 @@ const struct real_format ieee_double_format =
53,
-1021,
1024,
+ 63,
true,
true,
true,
@@ -3169,6 +3173,7 @@ const struct real_format ieee_extended_motorola_format =
64,
-16382,
16384,
+ 95,
true,
true,
true,
@@ -3185,6 +3190,7 @@ const struct real_format ieee_extended_intel_96_format =
64,
-16381,
16384,
+ 79,
true,
true,
true,
@@ -3201,6 +3207,7 @@ const struct real_format ieee_extended_intel_128_format =
64,
-16381,
16384,
+ 79,
true,
true,
true,
@@ -3294,6 +3301,7 @@ const struct real_format ibm_extended_format =
53 + 53,
-1021,
1024,
+ -1,
true,
true,
true,
@@ -3547,6 +3555,7 @@ const struct real_format ieee_quad_format =
113,
-16381,
16384,
+ 127,
true,
true,
true,
@@ -3854,6 +3863,7 @@ const struct real_format vax_f_format =
24,
-127,
127,
+ 15,
false,
false,
false,
@@ -3870,6 +3880,7 @@ const struct real_format vax_d_format =
56,
-127,
127,
+ 15,
false,
false,
false,
@@ -3886,6 +3897,7 @@ const struct real_format vax_g_format =
53,
-1023,
1023,
+ 15,
false,
false,
false,
@@ -4067,6 +4079,7 @@ const struct real_format i370_single_format =
6,
-64,
63,
+ 31,
false,
false,
false, /* ??? The encoding does allow for "unnormals". */
@@ -4083,6 +4096,7 @@ const struct real_format i370_double_format =
14,
-64,
63,
+ 63,
false,
false,
false, /* ??? The encoding does allow for "unnormals". */
@@ -4297,6 +4311,7 @@ const struct real_format c4x_single_format =
24,
-126,
128,
+ -1,
false,
false,
false,
@@ -4313,6 +4328,7 @@ const struct real_format c4x_extended_format =
32,
-126,
128,
+ -1,
false,
false,
false,
@@ -4358,6 +4374,7 @@ const struct real_format real_internal_format =
SIGNIFICAND_BITS - 2,
-MAX_EXP,
MAX_EXP,
+ -1,
true,
true,
false,
@@ -4381,3 +4398,86 @@ const struct real_format *real_format_for_mode[TFmode - QFmode + 1] =
NULL, /* XFmode */
&ieee_quad_format /* TFmode */
};
+
+
+/* Calculate the square root of X in mode MODE, and store the result
+ in R. For details see "High Precision Division and Square Root",
+ Alan H. Karp and Peter Markstein, HP Lab Report 93-93-42, June
+ 1993. http://www.hpl.hp.com/techreports/93/HPL-93-42.pdf. */
+
+void
+real_sqrt (r, mode, x)
+ REAL_VALUE_TYPE *r;
+ enum machine_mode mode;
+ const REAL_VALUE_TYPE *x;
+{
+ static REAL_VALUE_TYPE halfthree;
+ static REAL_VALUE_TYPE half;
+ static bool init = false;
+ REAL_VALUE_TYPE h, t, i;
+ int iter, exp;
+
+ /* sqrt(-0.0) is -0.0. */
+ if (real_isnegzero (x))
+ {
+ *r = *x;
+ return;
+ }
+
+ /* Negative arguments return NaN. */
+ if (real_isneg (x))
+ {
+ /* Mode is ignored for canonical NaN. */
+ real_nan (r, "", 1, SFmode);
+ return;
+ }
+
+ /* Infinity and NaN return themselves. */
+ if (real_isinf (x) || real_isnan (x))
+ {
+ *r = *x;
+ return;
+ }
+
+ if (!init)
+ {
+ real_arithmetic (&half, RDIV_EXPR, &dconst1, &dconst2);
+ real_arithmetic (&halfthree, PLUS_EXPR, &dconst1, &half);
+ init = true;
+ }
+
+ /* Initial guess for reciprocal sqrt, i. */
+ exp = real_exponent (x);
+ real_ldexp (&i, &dconst1, -exp/2);
+
+ /* Newton's iteration for reciprocal sqrt, i. */
+ for (iter = 0; iter < 16; iter++)
+ {
+ /* i(n+1) = i(n) * (1.5 - 0.5*i(n)*i(n)*x). */
+ real_arithmetic (&t, MULT_EXPR, x, &i);
+ real_arithmetic (&h, MULT_EXPR, &t, &i);
+ real_arithmetic (&t, MULT_EXPR, &h, &half);
+ real_arithmetic (&h, MINUS_EXPR, &halfthree, &t);
+ real_arithmetic (&t, MULT_EXPR, &i, &h);
+
+ /* Check for early convergence. */
+ if (iter >= 6 && real_identical (&i, &t))
+ break;
+
+ /* ??? Unroll loop to avoid copying. */
+ i = t;
+ }
+
+ /* Final iteration: r = i*x + 0.5*i*x*(1.0 - i*(i*x)). */
+ real_arithmetic (&t, MULT_EXPR, x, &i);
+ real_arithmetic (&h, MULT_EXPR, &t, &i);
+ real_arithmetic (&i, MINUS_EXPR, &dconst1, &h);
+ real_arithmetic (&h, MULT_EXPR, &t, &i);
+ real_arithmetic (&i, MULT_EXPR, &half, &h);
+ real_arithmetic (&h, PLUS_EXPR, &t, &i);
+
+ /* ??? We need a Tuckerman test to get the last bit. */
+
+ real_convert (r, mode, &h);
+}
+
diff --git a/gcc/real.h b/gcc/real.h
index a979cea67ac..163c283c171 100644
--- a/gcc/real.h
+++ b/gcc/real.h
@@ -124,6 +124,9 @@ struct real_format
/* The maximum integer, x, such that b**(x-1) is representable. */
int emax;
+ /* The bit position of the sign bit, or -1 for a complex encoding. */
+ int signbit;
+
/* Properties of the format. */
bool has_nans;
bool has_inf;
@@ -346,5 +349,9 @@ extern bool exact_real_inverse PARAMS ((enum machine_mode, REAL_VALUE_TYPE *));
/* In tree.c: wrap up a REAL_VALUE_TYPE in a tree node. */
extern tree build_real PARAMS ((tree, REAL_VALUE_TYPE));
+/* Calculate R as the square root of X in the given machine mode. */
+extern void real_sqrt PARAMS ((REAL_VALUE_TYPE *,
+ enum machine_mode,
+ const REAL_VALUE_TYPE *));
#endif /* ! GCC_REAL_H */
diff --git a/gcc/recog.c b/gcc/recog.c
index d1db9c4e69d..48d291585df 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -22,6 +22,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tm_p.h"
#include "insn-config.h"
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 18bfeca3c75..18bc0623e91 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -153,6 +153,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "tm_p.h"
diff --git a/gcc/regclass.c b/gcc/regclass.c
index 20c7d3b03d1..0bb21084ec7 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -26,6 +26,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "hard-reg-set.h"
#include "rtl.h"
#include "expr.h"
diff --git a/gcc/regmove.c b/gcc/regmove.c
index c39e5cce7b7..ad4f2adf435 100644
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -27,6 +27,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h" /* stdio.h must precede rtl.h for FFS. */
#include "tm_p.h"
#include "insn-config.h"
diff --git a/gcc/regrename.c b/gcc/regrename.c
index 9b7dfd6d3c5..dce0e898751 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -22,6 +22,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tm_p.h"
#include "insn-config.h"
@@ -1328,7 +1330,7 @@ mode_change_ok (orig_mode, new_mode, regno)
static rtx
maybe_mode_change (orig_mode, copy_mode, new_mode, regno, copy_regno)
enum machine_mode orig_mode, copy_mode, new_mode;
- unsigned int regno, copy_regno;
+ unsigned int regno, copy_regno ATTRIBUTE_UNUSED;
{
if (orig_mode == new_mode)
return gen_rtx_raw_REG (new_mode, regno);
diff --git a/gcc/reload.c b/gcc/reload.c
index a5069241cc3..ad3f375a2ec 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -88,6 +88,8 @@ a register with any other reload. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tm_p.h"
#include "insn-config.h"
@@ -670,13 +672,13 @@ static enum reg_class
find_valid_class (m1, n, dest_regno)
enum machine_mode m1 ATTRIBUTE_UNUSED;
int n;
- unsigned int dest_regno;
+ unsigned int dest_regno ATTRIBUTE_UNUSED;
{
int best_cost = -1;
int class;
int regno;
enum reg_class best_class = NO_REGS;
- enum reg_class dest_class = REGNO_REG_CLASS (dest_regno);
+ enum reg_class dest_class ATTRIBUTE_UNUSED = REGNO_REG_CLASS (dest_regno);
unsigned int best_size = 0;
int cost;
@@ -5642,7 +5644,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
needless copies if SUBREG_REG is multi-word. */
if (REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER)
{
- int regno = subreg_regno (x);
+ int regno ATTRIBUTE_UNUSED = subreg_regno (x);
if (! (context ? REGNO_OK_FOR_INDEX_P (regno)
: REGNO_MODE_OK_FOR_BASE_P (regno, mode)))
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 399b1f1de2d..ef4deb94426 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "machmode.h"
#include "hard-reg-set.h"
@@ -2933,7 +2935,7 @@ eliminate_regs_in_insn (insn, replace)
rtx old_set = single_set (insn);
rtx new_body;
int val = 0;
- int i, any_changes;
+ int i;
rtx substed_operand[MAX_RECOG_OPERANDS];
rtx orig_operand[MAX_RECOG_OPERANDS];
struct elim_table *ep;
@@ -3108,7 +3110,6 @@ eliminate_regs_in_insn (insn, replace)
/* Eliminate all eliminable registers occurring in operands that
can be handled by reload. */
extract_insn (insn);
- any_changes = 0;
for (i = 0; i < recog_data.n_operands; i++)
{
orig_operand[i] = recog_data.operand[i];
@@ -3134,7 +3135,7 @@ eliminate_regs_in_insn (insn, replace)
substed_operand[i] = eliminate_regs (recog_data.operand[i], 0,
replace ? insn : NULL_RTX);
if (substed_operand[i] != orig_operand[i])
- val = any_changes = 1;
+ val = 1;
/* Terminate the search in check_eliminable_occurrences at
this point. */
*recog_data.operand_loc[i] = 0;
@@ -6871,7 +6872,6 @@ do_input_reload (chain, rl, j)
struct reload *rl;
int j;
{
- int expect_occurrences = 1;
rtx insn = chain->insn;
rtx old = (rl->in && GET_CODE (rl->in) == MEM
? rl->in_reg : rl->in);
@@ -6892,11 +6892,7 @@ do_input_reload (chain, rl, j)
&& GET_CODE (rl->in_reg) == MEM
&& reload_spill_index[j] >= 0
&& TEST_HARD_REG_BIT (reg_reloaded_valid, reload_spill_index[j]))
- {
- expect_occurrences
- = count_occurrences (PATTERN (insn), rl->in, 0) == 1 ? 0 : -1;
- rl->in = regno_reg_rtx[reg_reloaded_contents[reload_spill_index[j]]];
- }
+ rl->in = regno_reg_rtx[reg_reloaded_contents[reload_spill_index[j]]];
/* If we are reloading a register that was recently stored in with an
output-reload, see if we can prove there was
@@ -9154,7 +9150,7 @@ reload_cse_move2add (first)
use (set (reg) (reg)) instead.
We don't delete this insn, nor do we convert it into a
note, to avoid losing register notes or the return
- value flag. jump2 already knowns how to get rid of
+ value flag. jump2 already knows how to get rid of
no-op moves. */
if (new_src == const0_rtx)
success = validate_change (insn, &SET_SRC (pat), reg, 0);
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 31918ec43e3..e3859a6db41 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -122,6 +122,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "toplev.h"
#include "rtl.h"
#include "tm_p.h"
diff --git a/gcc/resource.c b/gcc/resource.c
index a72dd9ce1a4..7388aa31059 100644
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -20,6 +20,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "toplev.h"
#include "rtl.h"
#include "tm_p.h"
diff --git a/gcc/rtl-error.c b/gcc/rtl-error.c
index 2b660c94fb7..00992b1977f 100644
--- a/gcc/rtl-error.c
+++ b/gcc/rtl-error.c
@@ -23,6 +23,8 @@ Boston, MA 02111-1307, USA. */
#undef FLOAT /* This is for hpux. They should change hpux. */
#undef FFS /* Some systems define this in param.h. */
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "insn-attr.h"
#include "insn-config.h"
diff --git a/gcc/rtl.c b/gcc/rtl.c
index 065c02b40c3..c258f20d27b 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "real.h"
#include "ggc.h"
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 5f727b08d9c..72d07f550da 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1578,6 +1578,7 @@ extern rtx set_unique_reg_note PARAMS ((rtx, enum reg_note, rtx));
#define single_set_1(I) single_set_2 (I, PATTERN (I))
extern int rtx_addr_can_trap_p PARAMS ((rtx));
+extern bool nonzero_address_p PARAMS ((rtx));
extern int rtx_unstable_p PARAMS ((rtx));
extern int rtx_varies_p PARAMS ((rtx, int));
extern int rtx_addr_varies_p PARAMS ((rtx, int));
@@ -2144,7 +2145,7 @@ extern int function_invariant_p PARAMS ((rtx));
extern void init_branch_prob PARAMS ((const char *));
extern void branch_prob PARAMS ((void));
extern void end_branch_prob PARAMS ((void));
-extern void output_func_start_profiler PARAMS ((void));
+extern void create_profiler PARAMS ((void));
/* In reg-stack.c */
#ifdef BUFSIZ
@@ -2280,4 +2281,37 @@ extern bool expensive_function_p PARAMS ((int));
/* In tracer.c */
extern void tracer PARAMS ((void));
+/* In calls.c */
+
+/* Nonzero if this is a call to a `const' function. */
+#define ECF_CONST 1
+/* Nonzero if this is a call to a `volatile' function. */
+#define ECF_NORETURN 2
+/* Nonzero if this is a call to malloc or a related function. */
+#define ECF_MALLOC 4
+/* Nonzero if it is plausible that this is a call to alloca. */
+#define ECF_MAY_BE_ALLOCA 8
+/* Nonzero if this is a call to a function that won't throw an exception. */
+#define ECF_NOTHROW 16
+/* Nonzero if this is a call to setjmp or a related function. */
+#define ECF_RETURNS_TWICE 32
+/* Nonzero if this is a call to `longjmp'. */
+#define ECF_LONGJMP 64
+/* Nonzero if this is a syscall that makes a new process in the image of
+ the current one. */
+#define ECF_FORK_OR_EXEC 128
+#define ECF_SIBCALL 256
+/* Nonzero if this is a call to "pure" function (like const function,
+ but may read memory. */
+#define ECF_PURE 512
+/* Nonzero if this is a call to a function that returns with the stack
+ pointer depressed. */
+#define ECF_SP_DEPRESSED 1024
+/* Nonzero if this call is known to always return. */
+#define ECF_ALWAYS_RETURN 2048
+/* Create libcall block around the call. */
+#define ECF_LIBCALL_BLOCK 4096
+
+extern int flags_from_decl_or_type PARAMS ((tree));
+
#endif /* ! GCC_RTL_H */
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index c992c439bc3..924ef52581c 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -22,6 +22,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "toplev.h"
#include "rtl.h"
#include "hard-reg-set.h"
@@ -153,6 +155,10 @@ rtx_varies_p (x, for_alias)
case LABEL_REF:
return 0;
+ case ADDRESSOF:
+ /* This will resolve to some offset from the frame pointer. */
+ return 0;
+
case REG:
/* Note that we have to test for the actual rtx used for the frame
and arg pointers and not just the register number in case we have
@@ -225,6 +231,10 @@ rtx_addr_can_trap_p (x)
case LABEL_REF:
return 0;
+ case ADDRESSOF:
+ /* This will resolve to some offset from the frame pointer. */
+ return 0;
+
case REG:
/* As in rtx_varies_p, we have to use the actual rtx, not reg number. */
if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
@@ -269,6 +279,90 @@ rtx_addr_can_trap_p (x)
return 1;
}
+/* Return true if X is an address that is known to not be zero. */
+
+bool
+nonzero_address_p (x)
+ rtx x;
+{
+ enum rtx_code code = GET_CODE (x);
+
+ switch (code)
+ {
+ case SYMBOL_REF:
+ return !SYMBOL_REF_WEAK (x);
+
+ case LABEL_REF:
+ return true;
+
+ case ADDRESSOF:
+ /* This will resolve to some offset from the frame pointer. */
+ return true;
+
+ case REG:
+ /* As in rtx_varies_p, we have to use the actual rtx, not reg number. */
+ if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
+ || x == stack_pointer_rtx
+ || (x == arg_pointer_rtx && fixed_regs[ARG_POINTER_REGNUM]))
+ return true;
+ /* All of the virtual frame registers are stack references. */
+ if (REGNO (x) >= FIRST_VIRTUAL_REGISTER
+ && REGNO (x) <= LAST_VIRTUAL_REGISTER)
+ return true;
+ return false;
+
+ case CONST:
+ return nonzero_address_p (XEXP (x, 0));
+
+ case PLUS:
+ if (GET_CODE (XEXP (x, 1)) == CONST_INT)
+ {
+ /* Pointers aren't allowed to wrap. If we've got a register
+ that is known to be a pointer, and a positive offset, then
+ the composite can't be zero. */
+ if (INTVAL (XEXP (x, 1)) > 0
+ && REG_P (XEXP (x, 0))
+ && REG_POINTER (XEXP (x, 0)))
+ return true;
+
+ return nonzero_address_p (XEXP (x, 0));
+ }
+ /* Handle PIC references. */
+ else if (XEXP (x, 0) == pic_offset_table_rtx
+ && CONSTANT_P (XEXP (x, 1)))
+ return true;
+ return false;
+
+ case PRE_MODIFY:
+ /* Similar to the above; allow positive offsets. Further, since
+ auto-inc is only allowed in memories, the register must be a
+ pointer. */
+ if (GET_CODE (XEXP (x, 1)) == CONST_INT
+ && INTVAL (XEXP (x, 1)) > 0)
+ return true;
+ return nonzero_address_p (XEXP (x, 0));
+
+ case PRE_INC:
+ /* Similarly. Further, the offset is always positive. */
+ return true;
+
+ case PRE_DEC:
+ case POST_DEC:
+ case POST_INC:
+ case POST_MODIFY:
+ return nonzero_address_p (XEXP (x, 0));
+
+ case LO_SUM:
+ return nonzero_address_p (XEXP (x, 1));
+
+ default:
+ break;
+ }
+
+ /* If it isn't one of the case above, might be zero. */
+ return false;
+}
+
/* Return 1 if X refers to a memory location whose address
cannot be compared reliably with constant addresses,
or if X refers to a BLKmode memory object.
@@ -874,13 +968,10 @@ int
reg_set_p (reg, insn)
rtx reg, insn;
{
- rtx body = insn;
-
/* We can be passed an insn or part of one. If we are passed an insn,
check if a side-effect of the insn clobbers REG. */
- if (INSN_P (insn))
- {
- if (FIND_REG_INC_NOTE (insn, reg)
+ if (INSN_P (insn)
+ && (FIND_REG_INC_NOTE (insn, reg)
|| (GET_CODE (insn) == CALL_INSN
/* We'd like to test call_used_regs here, but rtlanal.c can't
reference that variable due to its use in genattrtab. So
@@ -891,11 +982,8 @@ reg_set_p (reg, insn)
&& ((GET_CODE (reg) == REG
&& REGNO (reg) < FIRST_PSEUDO_REGISTER)
|| GET_CODE (reg) == MEM
- || find_reg_fusage (insn, CLOBBER, reg))))
- return 1;
-
- body = PATTERN (insn);
- }
+ || find_reg_fusage (insn, CLOBBER, reg)))))
+ return 1;
return set_of (reg, insn) != NULL_RTX;
}
diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c
index 74aa7cd1b4e..8514a221227 100644
--- a/gcc/sbitmap.c
+++ b/gcc/sbitmap.c
@@ -20,6 +20,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "flags.h"
#include "hard-reg-set.h"
diff --git a/gcc/scan-decls.c b/gcc/scan-decls.c
index e56401d066f..62afffbe9d7 100644
--- a/gcc/scan-decls.c
+++ b/gcc/scan-decls.c
@@ -18,8 +18,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Written by Per Bothner <bothner@cygnus.com>, July 1993. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "cpplib.h"
#include "scan.h"
diff --git a/gcc/scan.c b/gcc/scan.c
index ac6b809799f..9e2476f92ac 100644
--- a/gcc/scan.c
+++ b/gcc/scan.c
@@ -15,8 +15,10 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "scan.h"
int lineno = 1;
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index 98b0732291b..ec695dd0233 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -24,6 +24,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "toplev.h"
#include "rtl.h"
#include "tm_p.h"
diff --git a/gcc/sched-ebb.c b/gcc/sched-ebb.c
index e9d7482e40e..3542b5d3714 100644
--- a/gcc/sched-ebb.c
+++ b/gcc/sched-ebb.c
@@ -23,6 +23,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "toplev.h"
#include "rtl.h"
#include "tm_p.h"
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index 88545b29b09..840375f1492 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -47,6 +47,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "toplev.h"
#include "rtl.h"
#include "tm_p.h"
@@ -173,7 +175,6 @@ typedef struct
bitlst;
static int bitlst_table_last;
-static int bitlst_table_size;
static int *bitlst_table;
static void extract_bitlst PARAMS ((sbitmap, bitlst *));
@@ -2013,7 +2014,6 @@ init_ready_list (ready)
bblst_table = (int *) xmalloc (bblst_size * sizeof (int));
bitlst_table_last = 0;
- bitlst_table_size = rgn_nr_edges;
bitlst_table = (int *) xmalloc (rgn_nr_edges * sizeof (int));
compute_trg_info (target_bb);
diff --git a/gcc/sched-vis.c b/gcc/sched-vis.c
index 237d4460d51..2046c4d98de 100644
--- a/gcc/sched-vis.c
+++ b/gcc/sched-vis.c
@@ -23,6 +23,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "toplev.h"
#include "rtl.h"
#include "tm_p.h"
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
index 9d5effd6f6e..0c972f15da8 100644
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -43,6 +43,8 @@ AT&T C compiler. From the example below I would conclude the following:
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "debug.h"
#include "tree.h"
#include "ggc.h"
@@ -61,6 +63,7 @@ static GTY(()) tree anonymous_types;
#include "tm_p.h"
#include "gsyms.h"
#include "langhooks.h"
+#include "target.h"
/* 1 if PARM is passed to this function in memory. */
diff --git a/gcc/sibcall.c b/gcc/sibcall.c
index 90863b7142b..91cd781fd7c 100644
--- a/gcc/sibcall.c
+++ b/gcc/sibcall.c
@@ -20,6 +20,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "regs.h"
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 212d3b90236..04c7b9f9a90 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -22,6 +22,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "tm_p.h"
@@ -39,41 +41,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Simplification and canonicalization of RTL. */
-/* Nonzero if X has the form (PLUS frame-pointer integer). We check for
- virtual regs here because the simplify_*_operation routines are called
- by integrate.c, which is called before virtual register instantiation.
-
- ?!? NONZERO_BASE_PLUS_P needs to move into
- a header file so that their definitions can be shared with the
- simplification routines in simplify-rtx.c. Until then, do not
- change this macro without also changing the copy in simplify-rtx.c. */
-
-/* Allows reference to the stack pointer.
-
- This used to include FIXED_BASE_PLUS_P, however, we can't assume that
- arg_pointer_rtx by itself is nonzero, because on at least one machine,
- the i960, the arg pointer is zero when it is unused. */
-
-#define NONZERO_BASE_PLUS_P(X) \
- ((X) == frame_pointer_rtx || (X) == hard_frame_pointer_rtx \
- || (X) == virtual_stack_vars_rtx \
- || (X) == virtual_incoming_args_rtx \
- || (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == CONST_INT \
- && (XEXP (X, 0) == frame_pointer_rtx \
- || XEXP (X, 0) == hard_frame_pointer_rtx \
- || ((X) == arg_pointer_rtx \
- && fixed_regs[ARG_POINTER_REGNUM]) \
- || XEXP (X, 0) == virtual_stack_vars_rtx \
- || XEXP (X, 0) == virtual_incoming_args_rtx)) \
- || (X) == stack_pointer_rtx \
- || (X) == virtual_stack_dynamic_rtx \
- || (X) == virtual_outgoing_args_rtx \
- || (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == CONST_INT \
- && (XEXP (X, 0) == stack_pointer_rtx \
- || XEXP (X, 0) == virtual_stack_dynamic_rtx \
- || XEXP (X, 0) == virtual_outgoing_args_rtx)) \
- || GET_CODE (X) == ADDRESSOF)
-
/* Much code operates on (low, high) pairs; the low value is an
unsigned wide int, the high value a signed wide int. We
occasionally need to sign extend from low to high as if low were a
@@ -606,15 +573,17 @@ simplify_unary_operation (code, mode, op, op_mode)
else if (GET_CODE (trueop) == CONST_DOUBLE
&& GET_MODE_CLASS (mode) == MODE_FLOAT)
{
- REAL_VALUE_TYPE d;
+ REAL_VALUE_TYPE d, t;
REAL_VALUE_FROM_CONST_DOUBLE (d, trueop);
switch (code)
{
case SQRT:
- /* We don't attempt to optimize this. */
- return 0;
-
+ if (HONOR_SNANS (mode) && real_isnan (&d))
+ return 0;
+ real_sqrt (&t, mode, &d);
+ d = t;
+ break;
case ABS:
d = REAL_VALUE_ABS (d);
break;
@@ -1344,6 +1313,7 @@ simplify_binary_operation (code, mode, op0, op1)
case ROTATERT:
case ROTATE:
+ case ASHIFTRT:
/* Rotating ~0 always results in ~0. */
if (GET_CODE (trueop0) == CONST_INT && width <= HOST_BITS_PER_WIDE_INT
&& (unsigned HOST_WIDE_INT) INTVAL (trueop0) == GET_MODE_MASK (mode)
@@ -1353,7 +1323,6 @@ simplify_binary_operation (code, mode, op0, op1)
/* ... fall through ... */
case ASHIFT:
- case ASHIFTRT:
case LSHIFTRT:
if (trueop1 == const0_rtx)
return op0;
@@ -2038,25 +2007,12 @@ simplify_relational_operation (code, mode, op0, op1)
switch (code)
{
case EQ:
- /* References to the frame plus a constant or labels cannot
- be zero, but a SYMBOL_REF can due to #pragma weak. */
- if (((NONZERO_BASE_PLUS_P (op0) && trueop1 == const0_rtx)
- || GET_CODE (trueop0) == LABEL_REF)
-#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
- /* On some machines, the ap reg can be 0 sometimes. */
- && op0 != arg_pointer_rtx
-#endif
- )
+ if (trueop1 == const0_rtx && nonzero_address_p (op0))
return const0_rtx;
break;
case NE:
- if (((NONZERO_BASE_PLUS_P (op0) && trueop1 == const0_rtx)
- || GET_CODE (trueop0) == LABEL_REF)
-#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
- && op0 != arg_pointer_rtx
-#endif
- )
+ if (trueop1 == const0_rtx && nonzero_address_p (op0))
return const_true_rtx;
break;
diff --git a/gcc/ssa-ccp.c b/gcc/ssa-ccp.c
index 44f49217305..64e5f240a3d 100644
--- a/gcc/ssa-ccp.c
+++ b/gcc/ssa-ccp.c
@@ -61,6 +61,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "hard-reg-set.h"
diff --git a/gcc/ssa-dce.c b/gcc/ssa-dce.c
index 09fcc7ad65a..3584ca2ebc8 100644
--- a/gcc/ssa-dce.c
+++ b/gcc/ssa-dce.c
@@ -69,6 +69,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "hard-reg-set.h"
diff --git a/gcc/ssa.c b/gcc/ssa.c
index b5c4992148e..b2c05bcf023 100644
--- a/gcc/ssa.c
+++ b/gcc/ssa.c
@@ -31,6 +31,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "expr.h"
diff --git a/gcc/stmt.c b/gcc/stmt.c
index f283b7590c6..7d6c398fc58 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -35,6 +35,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
@@ -166,9 +168,6 @@ struct nesting GTY(())
rtx start_label;
/* Label at the end of the whole construct. */
rtx end_label;
- /* Label before a jump that branches to the end of the whole
- construct. This is where destructors go if any. */
- rtx alt_end_label;
/* Label for `continue' statement to jump to;
this is in front of the stepper of the loop. */
rtx continue_label;
@@ -459,14 +458,6 @@ init_stmt_for_function ()
clear_last_expr ();
}
-/* Return nonzero if anything is pushed on the loop, condition, or case
- stack. */
-int
-in_control_zone_p ()
-{
- return cond_stack || loop_stack || case_stack;
-}
-
/* Record the current file and line. Called from emit_line_note. */
void
set_file_and_line_for_stmt (file, line)
@@ -1480,8 +1471,6 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
= (enum machine_mode *) alloca (noutputs * sizeof (enum machine_mode));
const char **constraints
= (const char **) alloca ((noutputs + ninputs) * sizeof (const char *));
- /* The insn we have emitted. */
- rtx insn;
int old_generating_concat_p = generating_concat_p;
/* An ASM with no outputs needs to be treated as volatile, for now. */
@@ -1774,13 +1763,13 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
if (noutputs == 1 && nclobbers == 0)
{
ASM_OPERANDS_OUTPUT_CONSTRAINT (body) = constraints[0];
- insn = emit_insn (gen_rtx_SET (VOIDmode, output_rtx[0], body));
+ emit_insn (gen_rtx_SET (VOIDmode, output_rtx[0], body));
}
else if (noutputs == 0 && nclobbers == 0)
{
/* No output operands: put in a raw ASM_OPERANDS rtx. */
- insn = emit_insn (body);
+ emit_insn (body);
}
else
@@ -1867,7 +1856,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
= gen_rtx_CLOBBER (VOIDmode, clobbered_reg);
}
- insn = emit_insn (body);
+ emit_insn (body);
}
/* For any outputs that needed reloading into registers, spill them
@@ -2495,7 +2484,6 @@ expand_start_loop (exit_flag)
thisloop->depth = ++nesting_depth;
thisloop->data.loop.start_label = gen_label_rtx ();
thisloop->data.loop.end_label = gen_label_rtx ();
- thisloop->data.loop.alt_end_label = 0;
thisloop->data.loop.continue_label = thisloop->data.loop.start_label;
thisloop->exit_label = exit_flag ? thisloop->data.loop.end_label : 0;
loop_stack = thisloop;
@@ -2537,7 +2525,6 @@ expand_start_null_loop ()
thisloop->depth = ++nesting_depth;
thisloop->data.loop.start_label = emit_note (NULL, NOTE_INSN_DELETED);
thisloop->data.loop.end_label = gen_label_rtx ();
- thisloop->data.loop.alt_end_label = NULL_RTX;
thisloop->data.loop.continue_label = thisloop->data.loop.end_label;
thisloop->exit_label = thisloop->data.loop.end_label;
loop_stack = thisloop;
@@ -2568,6 +2555,7 @@ expand_end_loop ()
rtx start_label = loop_stack->data.loop.start_label;
rtx etc_note;
int eh_regions, debug_blocks;
+ bool empty_test;
/* Mark the continue-point at the top of the loop if none elsewhere. */
if (start_label == loop_stack->data.loop.continue_label)
@@ -2611,6 +2599,7 @@ expand_end_loop ()
/* Scan insns from the top of the loop looking for the END_TOP_COND note. */
+ empty_test = true;
eh_regions = debug_blocks = 0;
for (etc_note = start_label; etc_note ; etc_note = NEXT_INSN (etc_note))
if (GET_CODE (etc_note) == NOTE)
@@ -2651,9 +2640,12 @@ expand_end_loop ()
else if (NOTE_LINE_NUMBER (etc_note) == NOTE_INSN_BLOCK_END)
debug_blocks--;
}
+ else if (INSN_P (etc_note))
+ empty_test = false;
if (etc_note
&& optimize
+ && ! empty_test
&& eh_regions == 0
&& (debug_blocks == 0 || optimize >= 2)
&& NEXT_INSN (etc_note) != NULL_RTX
@@ -2772,22 +2764,32 @@ expand_exit_loop_if_false (whichloop, cond)
struct nesting *whichloop;
tree cond;
{
- rtx label = gen_label_rtx ();
- rtx last_insn;
+ rtx label;
clear_last_expr ();
if (whichloop == 0)
whichloop = loop_stack;
if (whichloop == 0)
return 0;
+
+ if (integer_nonzerop (cond))
+ return 1;
+ if (integer_zerop (cond))
+ return expand_exit_loop (whichloop);
+
+ /* Check if we definitely won't need a fixup. */
+ if (whichloop == nesting_stack)
+ {
+ jumpifnot (cond, whichloop->data.loop.end_label);
+ return 1;
+ }
+
/* In order to handle fixups, we actually create a conditional jump
around an unconditional branch to exit the loop. If fixups are
necessary, they go before the unconditional branch. */
- do_jump (cond, NULL_RTX, label);
- last_insn = get_last_insn ();
- if (GET_CODE (last_insn) == CODE_LABEL)
- whichloop->data.loop.alt_end_label = last_insn;
+ label = gen_label_rtx ();
+ jumpif (cond, label);
expand_goto_internal (NULL_TREE, whichloop->data.loop.end_label,
NULL_RTX);
emit_label (label);
@@ -2811,17 +2813,6 @@ expand_exit_loop_top_cond (whichloop, cond)
return 1;
}
-/* Return nonzero if the loop nest is empty. Else return zero. */
-
-int
-stmt_loop_nest_empty ()
-{
- /* cfun->stmt can be NULL if we are building a call to get the
- EH context for a setjmp/longjmp EH target and the current
- function was a deferred inline function. */
- return (cfun->stmt == NULL || loop_stack == NULL);
-}
-
/* Return nonzero if we should preserve sub-expressions as separate
pseudos. We never do so if we aren't optimizing. We always do so
if -fexpensive-optimizations.
@@ -3204,18 +3195,6 @@ expand_return (retval)
expand_value_return (result_rtl);
}
}
-
-/* Return 1 if the end of the generated RTX is not a barrier.
- This means code already compiled can drop through. */
-
-int
-drop_through_at_end_p ()
-{
- rtx insn = get_last_insn ();
- while (insn && GET_CODE (insn) == NOTE)
- insn = PREV_INSN (insn);
- return insn && GET_CODE (insn) != BARRIER;
-}
/* Attempt to optimize a potential tail recursion call into a goto.
ARGUMENTS are the arguments to a CALL_EXPR; LAST_INSN indicates
@@ -3833,7 +3812,6 @@ void
expand_decl (decl)
tree decl;
{
- struct nesting *thisblock;
tree type;
type = TREE_TYPE (decl);
@@ -3859,8 +3837,6 @@ expand_decl (decl)
if (TREE_STATIC (decl) || DECL_EXTERNAL (decl))
return;
- thisblock = block_stack;
-
/* Create the RTL representation for the variable. */
if (type == error_mark_node)
@@ -4326,24 +4302,6 @@ end_cleanup_deferral ()
--block_stack->data.block.conditional_code;
}
-/* Move all cleanups from the current block_stack
- to the containing block_stack, where they are assumed to
- have been created. If anything can cause a temporary to
- be created, but not expanded for more than one level of
- block_stacks, then this code will have to change. */
-
-void
-move_cleanups_up ()
-{
- struct nesting *block = block_stack;
- struct nesting *outer = block->next;
-
- outer->data.block.cleanups
- = chainon (block->data.block.cleanups,
- outer->data.block.cleanups);
- block->data.block.cleanups = 0;
-}
-
tree
last_cleanup_this_contour ()
{
@@ -4453,26 +4411,6 @@ expand_start_case_dummy ()
nesting_stack = thiscase;
start_cleanup_deferral ();
}
-
-/* End a dummy case statement. */
-
-void
-expand_end_case_dummy ()
-{
- end_cleanup_deferral ();
- POPSTACK (case_stack);
-}
-
-/* Return the data type of the index-expression
- of the innermost case statement, or null if none. */
-
-tree
-case_index_expr_type ()
-{
- if (case_stack)
- return TREE_TYPE (case_stack->data.case_stmt.index_expr);
- return 0;
-}
static void
check_seenlabel ()
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index db4c09f29f7..83fbb294d7a 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -22,6 +22,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "tm_p.h"
@@ -60,6 +62,9 @@ static int reference_types_internal = 0;
static void finalize_record_size PARAMS ((record_layout_info));
static void finalize_type_size PARAMS ((tree));
static void place_union_field PARAMS ((record_layout_info, tree));
+static int excess_unit_span PARAMS ((HOST_WIDE_INT, HOST_WIDE_INT,
+ HOST_WIDE_INT, HOST_WIDE_INT,
+ tree));
static unsigned int update_alignment_for_field
PARAMS ((record_layout_info, tree,
unsigned int));
@@ -539,25 +544,6 @@ byte_from_pos (offset, bitpos)
}
void
-pos_from_byte (poffset, pbitpos, off_align, pos)
- tree *poffset, *pbitpos;
- unsigned int off_align;
- tree pos;
-{
- *poffset
- = size_binop (MULT_EXPR,
- convert (sizetype,
- size_binop (FLOOR_DIV_EXPR, pos,
- bitsize_int (off_align
- / BITS_PER_UNIT))),
- size_int (off_align / BITS_PER_UNIT));
- *pbitpos = size_binop (MULT_EXPR,
- size_binop (FLOOR_MOD_EXPR, pos,
- bitsize_int (off_align / BITS_PER_UNIT)),
- bitsize_unit_node);
-}
-
-void
pos_from_bit (poffset, pbitpos, off_align, pos)
tree *poffset, *pbitpos;
unsigned int off_align;
@@ -797,6 +783,24 @@ place_union_field (rli, field)
DECL_SIZE_UNIT (field), rli->offset));
}
+/* A bitfield of SIZE with a required access alignment of ALIGN is allocated
+ at BYTE_OFFSET / BIT_OFFSET. Return non-zero if the field would span more
+ units of alignment than the underlying TYPE. */
+static int
+excess_unit_span (byte_offset, bit_offset, size, align, type)
+ HOST_WIDE_INT byte_offset, bit_offset, size, align;
+ tree type;
+{
+ /* Note that the calculation of OFFSET might overflow; we calculate it so
+ that we still get the right result as long as ALIGN is a power of two. */
+ unsigned HOST_WIDE_INT offset = byte_offset * BITS_PER_UNIT + bit_offset;
+
+ offset = offset % align;
+ return ((offset + size + align - 1) / align
+ > ((unsigned HOST_WIDE_INT) tree_low_cst (TYPE_SIZE (type), 1)
+ / align));
+}
+
/* RLI contains information about the layout of a RECORD_TYPE. FIELD
is a FIELD_DECL to be added after those fields already present in
T. (FIELD is not actually added to the TYPE_FIELDS list here;
@@ -935,11 +939,7 @@ place_field (rli, field)
/* A bit field may not span more units of alignment of its type
than its type itself. Advance to next boundary if necessary. */
- if ((((offset * BITS_PER_UNIT + bit_offset + field_size +
- type_align - 1)
- / type_align)
- - (offset * BITS_PER_UNIT + bit_offset) / type_align)
- > tree_low_cst (TYPE_SIZE (type), 1) / type_align)
+ if (excess_unit_span (offset, bit_offset, field_size, type_align, type))
rli->bitpos = round_up (rli->bitpos, type_align);
TYPE_USER_ALIGN (rli->t) |= TYPE_USER_ALIGN (type);
@@ -978,11 +978,7 @@ place_field (rli, field)
/* A bit field may not span the unit of alignment of its type.
Advance to next boundary if necessary. */
- /* ??? This code should match the code above for the
- PCC_BITFIELD_TYPE_MATTERS case. */
- if ((offset * BITS_PER_UNIT + bit_offset) / type_align
- != ((offset * BITS_PER_UNIT + bit_offset + field_size - 1)
- / type_align))
+ if (excess_unit_span (offset, bit_offset, field_size, type_align, type))
rli->bitpos = round_up (rli->bitpos, type_align);
TYPE_USER_ALIGN (rli->t) |= TYPE_USER_ALIGN (type);
@@ -993,12 +989,12 @@ place_field (rli, field)
A subtlety:
When a bit field is inserted into a packed record, the whole
size of the underlying type is used by one or more same-size
- adjacent bitfields. (That is, if its long:3, 32 bits is
+ adjacent bitfields. (That is, if its long:3, 32 bits is
used in the record, and any additional adjacent long bitfields are
packed into the same chunk of 32 bits. However, if the size
changes, a new field of that size is allocated.) In an unpacked
record, this is the same as using alignment, but not eqivalent
- when packing.
+ when packing.
Note: for compatability, we use the type size, not the type alignment
to determine alignment, since that matches the documentation */
@@ -1047,8 +1043,8 @@ place_field (rli, field)
}
else
{
- /* End of a run: if leaving a run of bitfields of the same type
- size, we have to "use up" the rest of the bits of the type
+ /* End of a run: if leaving a run of bitfields of the same type
+ size, we have to "use up" the rest of the bits of the type
size.
Compute the new position as the sum of the size for the prior
@@ -1070,7 +1066,7 @@ place_field (rli, field)
prev_saved = NULL;
}
- /* Cause a new bitfield to be captured, either this time (if
+ /* Cause a new bitfield to be captured, either this time (if
currently a bitfield) or next time we see one. */
if (!DECL_BIT_FIELD_TYPE(field)
|| integer_zerop (DECL_SIZE (field)))
@@ -1083,7 +1079,7 @@ place_field (rli, field)
/* If we're starting a new run of same size type bitfields
(or a run of non-bitfields), set up the "first of the run"
- fields.
+ fields.
That is, if the current field is not a bitfield, or if there
was a prior bitfield the type sizes differ, or if there wasn't
@@ -1094,20 +1090,20 @@ place_field (rli, field)
there wasn't. */
if (!DECL_BIT_FIELD_TYPE (field)
- || ( prev_saved != NULL
+ || ( prev_saved != NULL
? !simple_cst_equal (TYPE_SIZE (type),
TYPE_SIZE (TREE_TYPE (prev_saved)))
: !integer_zerop (DECL_SIZE (field)) ))
{
unsigned int type_align = 8; /* Never below 8 for compatability */
- /* (When not a bitfield), we could be seeing a flex array (with
+ /* (When not a bitfield), we could be seeing a flex array (with
no DECL_SIZE). Since we won't be using remaining_in_alignment
- until we see a bitfield (and come by here again) we just skip
+ until we see a bitfield (and come by here again) we just skip
calculating it. */
-
+
if (DECL_SIZE (field) != NULL)
- rli->remaining_in_alignment
+ rli->remaining_in_alignment
= TREE_INT_CST_LOW (TYPE_SIZE(TREE_TYPE(field)))
- TREE_INT_CST_LOW (DECL_SIZE (field));
@@ -1500,6 +1496,46 @@ finish_record_layout (rli, free_p)
free (rli);
}
+
+/* Finish processing a builtin RECORD_TYPE type TYPE. It's name is
+ NAME, its fields are chained in reverse on FIELDS.
+
+ If ALIGN_TYPE is non-null, it is given the same alignment as
+ ALIGN_TYPE. */
+
+void
+finish_builtin_struct (type, name, fields, align_type)
+ tree type;
+ const char *name;
+ tree fields;
+ tree align_type;
+{
+ tree tail, next;
+
+ for (tail = NULL_TREE; fields; tail = fields, fields = next)
+ {
+ DECL_FIELD_CONTEXT (fields) = type;
+ next = TREE_CHAIN (fields);
+ TREE_CHAIN (fields) = tail;
+ }
+ TYPE_FIELDS (type) = tail;
+
+ if (align_type)
+ {
+ TYPE_ALIGN (type) = TYPE_ALIGN (align_type);
+ TYPE_USER_ALIGN (type) = TYPE_USER_ALIGN (align_type);
+ }
+
+ layout_type (type);
+#if 0 /* not yet, should get fixed properly later */
+ TYPE_NAME (type) = make_type_decl (get_identifier (name), type);
+#else
+ TYPE_NAME (type) = build_decl (TYPE_DECL, get_identifier (name), type);
+#endif
+ TYPE_STUB_DECL (type) = TYPE_NAME (type);
+ layout_decl (TYPE_NAME (type), 0);
+}
+
/* Calculate the mode, size, and alignment for TYPE.
For an array type, calculate the element separation as well.
Record TYPE on the chain of permanent or temporary types
@@ -1600,13 +1636,15 @@ layout_type (type)
case POINTER_TYPE:
case REFERENCE_TYPE:
{
- int nbits = ((TREE_CODE (type) == REFERENCE_TYPE
- && reference_types_internal)
- ? GET_MODE_BITSIZE (Pmode) : POINTER_SIZE);
- TYPE_MODE (type) = nbits == POINTER_SIZE ? ptr_mode : Pmode;
+ enum machine_mode mode = ((TREE_CODE (type) == REFERENCE_TYPE
+ && reference_types_internal)
+ ? Pmode : TYPE_MODE (type));
+
+ int nbits = GET_MODE_BITSIZE (mode);
+
TYPE_SIZE (type) = bitsize_int (nbits);
- TYPE_SIZE_UNIT (type) = size_int (nbits / BITS_PER_UNIT);
+ TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (mode));
TREE_UNSIGNED (type) = 1;
TYPE_PRECISION (type) = nbits;
}
diff --git a/gcc/stringpool.c b/gcc/stringpool.c
index 639048625d9..f3b34b139cf 100644
--- a/gcc/stringpool.c
+++ b/gcc/stringpool.c
@@ -29,6 +29,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "ggc.h"
#include "tree.h"
#include "hashtable.h"
diff --git a/gcc/system.h b/gcc/system.h
index 5adbd32b9c6..8d1c521d883 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -567,6 +567,13 @@ typedef char _Bool;
#define really_call_calloc calloc
#define really_call_realloc realloc
+#if defined(FLEX_SCANNER) || defined(YYBISON)
+/* Flex and bison use malloc and realloc. Yuk. Note that this means
+ really_call_* cannot be used in a .l or .y file. */
+#define malloc xmalloc
+#define realloc xrealloc
+#endif
+
#if (GCC_VERSION >= 3000)
/* Note autoconf checks for prototype declarations and includes
@@ -578,11 +585,7 @@ typedef char _Bool;
#undef strdup
#pragma GCC poison calloc strdup
-#if defined(FLEX_SCANNER) || defined (YYBISON)
-/* Flex and bison use malloc and realloc. Yuk. */
-#define malloc xmalloc
-#define realloc xrealloc
-#else
+#if !defined(FLEX_SCANNER) && !defined(YYBISON)
#undef malloc
#undef realloc
#pragma GCC poison malloc realloc
@@ -617,7 +620,7 @@ typedef char _Bool;
BLOCK_PROFILER BLOCK_PROFILER_CODE FUNCTION_BLOCK_PROFILER \
FUNCTION_BLOCK_PROFILER_EXIT MACHINE_STATE_SAVE \
MACHINE_STATE_RESTORE SCCS_DIRECTIVE SECTION_ASM_OP \
- ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
+ ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL ASM_OUTPUT_INTERNAL_LABEL
/* 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 154d58d47e9..5842863245e 100644
--- a/gcc/target-def.h
+++ b/gcc/target-def.h
@@ -57,6 +57,9 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef TARGET_ASM_GLOBALIZE_LABEL
#define TARGET_ASM_GLOBALIZE_LABEL default_globalize_label
#endif
+#ifndef TARGET_ASM_INTERNAL_LABEL
+#define TARGET_ASM_INTERNAL_LABEL default_internal_label
+#endif
#ifndef TARGET_ASM_ASSEMBLE_VISIBILITY
#define TARGET_ASM_ASSEMBLE_VISIBILITY default_assemble_visibility
@@ -164,6 +167,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_ASM_UNALIGNED_INT_OP, \
TARGET_ASM_INTEGER, \
TARGET_ASM_GLOBALIZE_LABEL, \
+ TARGET_ASM_INTERNAL_LABEL, \
TARGET_ASM_ASSEMBLE_VISIBILITY, \
TARGET_ASM_FUNCTION_PROLOGUE, \
TARGET_ASM_FUNCTION_END_PROLOGUE, \
@@ -239,9 +243,14 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TARGET_BINDS_LOCAL_P default_binds_local_p
#endif
+#ifndef TARGET_VALID_POINTER_MODE
+#define TARGET_VALID_POINTER_MODE default_valid_pointer_mode
+#endif
+
/* In hook.c. */
#define TARGET_CANNOT_MODIFY_JUMPS_P hook_bool_void_false
#define TARGET_CANNOT_FORCE_CONST_MEM hook_bool_rtx_false
+#define TARGET_FUNCTION_OK_FOR_SIBCALL hook_bool_tree_tree_false
#define TARGET_COMP_TYPE_ATTRIBUTES hook_int_tree_tree_1
#define TARGET_SET_DEFAULT_TYPE_ATTRIBUTES hook_void_tree
#define TARGET_INSERT_ATTRIBUTES hook_void_tree_treeptr
@@ -274,10 +283,12 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_SECTION_TYPE_FLAGS, \
TARGET_CANNOT_MODIFY_JUMPS_P, \
TARGET_CANNOT_FORCE_CONST_MEM, \
+ TARGET_FUNCTION_OK_FOR_SIBCALL, \
TARGET_IN_SMALL_DATA_P, \
TARGET_BINDS_LOCAL_P, \
TARGET_ENCODE_SECTION_INFO, \
TARGET_STRIP_NAME_ENCODING, \
+ TARGET_VALID_POINTER_MODE, \
TARGET_HAVE_NAMED_SECTIONS, \
TARGET_HAVE_CTORS_DTORS, \
TARGET_HAVE_TLS, \
diff --git a/gcc/target.h b/gcc/target.h
index 0ac1c5aa17b..98e32d5791a 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -72,6 +72,9 @@ struct gcc_target
/* Output code that will globalize a label. */
void (* globalize_label) PARAMS ((FILE *, const char *));
+ /* Output an internal label. */
+ void (* internal_label) PARAMS ((FILE *, const char *, unsigned long));
+
/* Emit an assembler directive to set visibility for the symbol
associated with the tree decl. */
void (* visibility) PARAMS ((tree, int));
@@ -265,6 +268,11 @@ struct gcc_target
/* True if the constant X cannot be placed in the constant pool. */
bool (* cannot_force_const_mem) PARAMS ((rtx));
+ /* True if it is OK to do sibling call optimization for the specified
+ call expression EXP. DECL will be the called function, or NULL if
+ this is an indirect call. */
+ bool (*function_ok_for_sibcall) PARAMS ((tree decl, tree exp));
+
/* True if EXP should be placed in a "small data" section. */
bool (* in_small_data_p) PARAMS ((tree));
@@ -279,6 +287,7 @@ struct gcc_target
/* Undo the effects of encode_section_info on the symbol string. */
const char * (* strip_name_encoding) PARAMS ((const char *));
+ bool (* valid_pointer_mode) PARAMS ((enum machine_mode mode));
/* Leave the boolean fields at the end. */
/* True if arbitrary sections are supported. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7fc603cc378..8db8e7385cc 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -4,7 +4,7 @@
* gcc.dg/darwin-ld-3.c: New test.
* gcc.dg/darwin-ld-4.c: New test.
* gcc.dg/darwin-ld-5.c: New test.
-
+
2002-12-12 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.c-torture/compile/20021212-1.c: New test.
@@ -51,6 +51,14 @@
* gcc.c-torture/compile/20021204-1.c: New test.
+2002-12-03 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.dg/inherit/covariant2.C: New test.
+ * g++.dg/inherit/covariant3.C: New test.
+ * g++.dg/inherit/covariant4.C: New test.
+ * g++.dg/inherit/covariant1.C: Remove XFAIL.
+ * g++.old-deja/g++.robertl/eb17.C: Likewise.
+
2002-12-03 Mark Mitchell <mark@codesourcery.com>
PR c++/8688
@@ -82,7 +90,7 @@
PR c++/8727
* g++.dg/inherit/typeinfo1.C: New test.
-
+
PR c++/8663
* g++.dg/inherit/typedef1.C: New test.
@@ -118,6 +126,11 @@ Wed Nov 27 14:37:34 CET 2002 Jan Hubicka <jh@suse.cz>
* gcc.c-torture/execute/20021127.[cx]: New test.
+Tue Nov 26 22:09:53 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/i386-cmov[123].c: New tests for conditional move code
+ quality.
+
2002-11-26 Geoffrey Keating <geoffk@apple.com>
* g++.dg/init/brace2.C: New test.
@@ -127,6 +140,10 @@ Wed Nov 27 14:37:34 CET 2002 Jan Hubicka <jh@suse.cz>
* g++.dg/abi/empty10.C: Don't run on non-x86 targets.
+2002-11-25 Andreas Bauer <baueran@in.tum.de>
+
+ * gcc.dg/sibcall-6: New test for indirect sibcalls.
+
2002-11-25 Mark Mitchell <mark@codesourcery.com>
* testsuite/g++.dg/abi/empty11.C: New test.
@@ -231,7 +248,7 @@ Wed Nov 27 14:37:34 CET 2002 Jan Hubicka <jh@suse.cz>
PR c/8439
* gcc.dg/20021110.c: New test.
-
+
2002-11-10 Mark Mitchell <mark@codesourcery.com>
* g++.dg/abi/vthunk3.C: Run only on x86.
@@ -254,6 +271,11 @@ Wed Nov 27 14:37:34 CET 2002 Jan Hubicka <jh@suse.cz>
PR c++/8389
* g++.dg/template/access6.C: New test.
+Fri Nov 8 13:13:53 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/i386-ssefp-1.c: New test.
+ * gcc.dg/i386-ssefp-1.c: New test.
+
Fri Nov 8 10:52:15 CET 2002 Jan Hubicka <jh@suse.cz>
* gcc.c-torture/compile/20021108-1.c: New testcase for x86-64 failure.
@@ -399,6 +421,10 @@ Fri Nov 8 10:52:15 CET 2002 Jan Hubicka <jh@suse.cz>
* g++.dg/expr/cond1.C: New test.
+2002-10-21 Zack Weinberg <zack@codesourcery.com>
+
+ * gcc.dg/sibcall-5.c: Correct { dg-do run } line.
+
2002-10-21 Mark Mitchell <mark@codesourcery.com>
* g++.dg/abi/vbase13.C: New test.
@@ -658,6 +684,10 @@ Fri Oct 11 10:56:49 2002 Richard Shann <richard.shann@superh.com>
* gcc.c-torture/compile/simd-5.c: New test.
+2002-10-10 Roger Sayle <roger@eyesopen.com>
+
+ * gcc.c-torture/execute/shiftopt-1.c: New test case.
+
2002-10-10 Jim Wilson <wilson@redhat.com>
* gcc.c-torture/execute/20021010-1.c: New test.
@@ -1077,6 +1107,11 @@ Thu Sep 5 00:34:33 2002 J"orn Rennecke <joern.rennecke@superh.com>
* gcc.dg/typeof-2.c: New test.
+2002-09-03 Roger Sayle <roger@eyesopen.com>
+
+ * gcc.dg/builtins-2.c: New testcase.
+ * gcc.dg/builtins-3.c: New testcase.
+
2002-09-03 Neil Booth <neil@daikokuya.co.uk>
* gcc.dg/cpp/_Pragma4.c: New test.
diff --git a/gcc/testsuite/g++.dg/inherit/covariant1.C b/gcc/testsuite/g++.dg/inherit/covariant1.C
index 516047e95e3..978c3e8255a 100644
--- a/gcc/testsuite/g++.dg/inherit/covariant1.C
+++ b/gcc/testsuite/g++.dg/inherit/covariant1.C
@@ -1,12 +1,6 @@
// PR c++/5607
-// Currently we don't support covariant returns that would actually require
-// a pointer adjustment. We were failing to recognize this as such a case,
-// so were silently generating bad code. When we do support covariant
-// returns properly, the expected error should go away, and the testcase
-// should pass execution.
-
-// { NOT YET dg-do run }
+// { dg-do run }
class A {
public:
@@ -19,7 +13,7 @@ public:
virtual B* getThis() { return this; }
};
-class AB : public A, public B { // { dg-error "covariant" }
+class AB : public A, public B {
public:
virtual AB* getThis() { return this; }
};
diff --git a/gcc/testsuite/g++.dg/inherit/covariant2.C b/gcc/testsuite/g++.dg/inherit/covariant2.C
new file mode 100644
index 00000000000..b6d93d6b571
--- /dev/null
+++ b/gcc/testsuite/g++.dg/inherit/covariant2.C
@@ -0,0 +1,70 @@
+// { dg-do run }
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Nov 2002 <nathan@codesourcery.com>
+
+// covariant returns. Fixed offset.
+
+struct B1;
+struct B2;
+struct D;
+
+struct B1
+{
+ virtual B1 *foo1 () {return this;}
+ virtual B2 *foo2 (D *);
+};
+struct B2
+{
+ virtual B2 *baz1 () {return this;}
+ virtual B1 *baz2 (D *);
+};
+
+struct D : B1, B2
+{
+ virtual D *foo1 () {return this;}
+ virtual D *foo2 (D *d) {return d;}
+ virtual D *baz1 () {return this;}
+ virtual D *baz2 (D *d) {return d;}
+};
+
+B2 *B1::foo2 (D *d) {return d;}
+B1 *B2::baz2 (D *d) {return d;}
+
+int test (B1 *b1, B2 *b2, D *d)
+{
+ if (b1->foo1 () != b1)
+ return 1;
+ if (b2->baz1 () != b2)
+ return 2;
+ if (b1->foo2 (d) != b2)
+ return 3;
+ if (b2->baz2 (d) != b1)
+ return 4;
+ return 0;
+}
+
+int test (D *d)
+{
+ if (d->foo2 (d) != d)
+ return 11;
+ if (d->baz2 (d) != d)
+ return 12;
+ if (d->foo1 () != d)
+ return 13;
+ if (d->baz1 () != d)
+ return 14;
+ return 0;
+}
+
+int main ()
+{
+ D d;
+ int r;
+
+ if ((r = test (&d, &d, &d)))
+ return r;
+ if ((r = test (&d)))
+ return r;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/inherit/covariant3.C b/gcc/testsuite/g++.dg/inherit/covariant3.C
new file mode 100644
index 00000000000..b7024c45593
--- /dev/null
+++ b/gcc/testsuite/g++.dg/inherit/covariant3.C
@@ -0,0 +1,70 @@
+// { dg-do run }
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Nov 2002 <nathan@codesourcery.com>
+
+// covariant returns. Virtual offset.
+
+struct B1;
+struct B2;
+struct D;
+
+struct B1
+{
+ virtual B1 *foo1 () {return this;}
+ virtual B2 *foo2 (D *);
+};
+struct B2
+{
+ virtual B2 *baz1 () {return this;}
+ virtual B1 *baz2 (D *);
+};
+
+struct D : virtual B1, virtual B2
+{
+ virtual D *foo1 () {return this;}
+ virtual D *foo2 (D *d) {return d;}
+ virtual D *baz1 () {return this;}
+ virtual D *baz2 (D *d) {return d;}
+};
+
+B2 *B1::foo2 (D *d) {return d;}
+B1 *B2::baz2 (D *d) {return d;}
+
+int test (B1 *b1, B2 *b2, D *d)
+{
+ if (b1->foo1 () != b1)
+ return 1;
+ if (b2->baz1 () != b2)
+ return 2;
+ if (b1->foo2 (d) != b2)
+ return 3;
+ if (b2->baz2 (d) != b1)
+ return 4;
+ return 0;
+}
+
+int test (D *d)
+{
+ if (d->foo2 (d) != d)
+ return 11;
+ if (d->baz2 (d) != d)
+ return 12;
+ if (d->foo1 () != d)
+ return 13;
+ if (d->baz1 () != d)
+ return 14;
+ return 0;
+}
+
+int main ()
+{
+ D d;
+ int r;
+
+ if ((r = test (&d, &d, &d)))
+ return r;
+ if ((r = test (&d)))
+ return r;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/inherit/covariant4.C b/gcc/testsuite/g++.dg/inherit/covariant4.C
new file mode 100644
index 00000000000..8f6101b3fc5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/inherit/covariant4.C
@@ -0,0 +1,76 @@
+// { dg-do run }
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Nov 2002 <nathan@codesourcery.com>
+
+// covariant returns. Fixed & virtual offset.
+
+struct B1;
+struct B2;
+struct D;
+
+struct B1
+{
+ virtual B1 *foo1 () {return this;}
+ virtual B2 *foo2 (D *);
+};
+
+struct B2
+{
+ virtual B2 *baz1 () {return this;}
+ virtual B1 *baz2 (D *);
+};
+
+struct Pad1 { virtual ~Pad1 (){}};
+struct Pad2 { virtual ~Pad2 (){}};
+struct Proxy1 : Pad1, B1 {};
+struct Proxy2 : Pad2, B2 {};
+
+struct D : virtual Proxy1, virtual Proxy2
+{
+ virtual D *foo1 () {return this;}
+ virtual D *foo2 (D *d) {return d;}
+ virtual D *baz1 () {return this;}
+ virtual D *baz2 (D *d) {return d;}
+};
+
+B2 *B1::foo2 (D *d) {return d;}
+B1 *B2::baz2 (D *d) {return d;}
+
+int test (B1 *b1, B2 *b2, D *d)
+{
+ if (b1->foo1 () != b1)
+ return 1;
+ if (b2->baz1 () != b2)
+ return 2;
+ if (b1->foo2 (d) != b2)
+ return 3;
+ if (b2->baz2 (d) != b1)
+ return 4;
+ return 0;
+}
+
+int test (D *d)
+{
+ if (d->foo2 (d) != d)
+ return 11;
+ if (d->baz2 (d) != d)
+ return 12;
+ if (d->foo1 () != d)
+ return 13;
+ if (d->baz1 () != d)
+ return 14;
+ return 0;
+}
+
+int main ()
+{
+ D d;
+ int r;
+
+ if ((r = test (&d, &d, &d)))
+ return r;
+ if ((r = test (&d)))
+ return r;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb17.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb17.C
index 3f2cc2f33e2..7cb5009030f 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb17.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb17.C
@@ -1,5 +1,3 @@
-// excess errors test - XFAIL
-// covariant return types in are currently not support for complex inheritance
#include <stdio.h>
class A {
diff --git a/gcc/testsuite/gcc.c-torture/execute/shiftopt-1.c b/gcc/testsuite/gcc.c-torture/execute/shiftopt-1.c
new file mode 100644
index 00000000000..fa9517a73db
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/shiftopt-1.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2002 Free Software Foundation
+
+ Check that constant folding of shift operations is working.
+
+ Roger Sayle, 10th October 2002. */
+
+extern void abort (void);
+extern void link_error (void);
+
+void
+utest (unsigned int x)
+{
+ if (x >> 0 != x)
+ link_error ();
+
+ if (x << 0 != x)
+ link_error ();
+
+ if (0 << x != 0)
+ link_error ();
+
+ if (0 >> x != 0)
+ link_error ();
+
+ if (-1 >> x != -1)
+ link_error ();
+
+ if (~0 >> x != ~0)
+ link_error ();
+}
+
+void
+stest (int x)
+{
+ if (x >> 0 != x)
+ link_error ();
+
+ if (x << 0 != x)
+ link_error ();
+
+ if (0 << x != 0)
+ link_error ();
+
+ if (0 >> x != 0)
+ link_error ();
+
+ if (-1 >> x != -1)
+ link_error ();
+
+ if (~0 >> x != ~0)
+ link_error ();
+}
+
+int
+main ()
+{
+ utest(9);
+ utest(0);
+
+ stest(9);
+ stest(0);
+
+ return 0;
+}
+
+#ifndef __OPTIMIZE__
+void
+link_error ()
+{
+ abort ();
+}
+#endif
+
diff --git a/gcc/testsuite/gcc.dg/bf-ms-layout.c b/gcc/testsuite/gcc.dg/bf-ms-layout.c
new file mode 100644
index 00000000000..575ea2fe4a5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/bf-ms-layout.c
@@ -0,0 +1,232 @@
+/* bf-ms-layout.c */
+
+/* Test for MS bitfield layout */
+/* Adapted from Donn Terry <donnte@microsoft.com> testcase
+ posted to GCC-patches
+ http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00577.html */
+
+/* { dg-do run { target *-*-interix* } } */
+/* { dg-options "-mms-bitfields -D_TEST_MS_LAYOUT" } */
+
+#include <stddef.h>
+#include <string.h>
+
+extern void abort();
+
+#pragma pack(8)
+
+struct one {
+ int d;
+ unsigned char a;
+ unsigned short b:7;
+ char c;
+};
+
+struct two {
+ int d;
+ unsigned char a;
+ unsigned int b:7;
+ char c;
+};
+
+struct three {
+ short d;
+ unsigned short a:3;
+ unsigned short b:9;
+ unsigned char c:7;
+};
+
+
+/* Bitfields of size 0 have some truly odd behaviors. */
+
+struct four {
+ unsigned short a:3;
+ unsigned short b:9;
+ unsigned int :0; /* forces struct alignment to int */
+ unsigned char c:7;
+};
+
+struct five {
+ char a;
+ int :0; /* ignored; prior field is not a bitfield. */
+ char b;
+ char c;
+};
+
+struct six {
+ char a :8;
+ int :0; /* not ignored; prior field IS a bitfield, causes
+ struct alignment as well. */
+ char b;
+ char c;
+} ;
+
+struct seven {
+ char a:8;
+ char :0;
+ int :0; /* Ignored; prior field is zero size bitfield. */
+ char b;
+ char c;
+};
+
+struct eight { /* ms size 4 */
+ short b:3;
+ char c;
+};
+
+#ifdef _MSC_VER
+#define LONGLONG __int64
+#else
+#define LONGLONG long long
+#endif
+
+union nine { /* ms size 8 */
+ LONGLONG a:3;
+ char c;
+};
+
+struct ten { /* ms size 16 */
+ LONGLONG a:3;
+ LONGLONG b:3;
+ char c;
+};
+
+
+#define val(s,f) (s.f)
+
+#define check_struct(_X) \
+{ \
+ if (sizeof (struct _X) != exp_sizeof_##_X ) \
+ abort(); \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+#define check_union(_X) \
+{ \
+ if (sizeof (union _X) != exp_sizeof_##_X ) \
+ abort(); \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+#define check_struct_size(_X) \
+{ \
+ if (sizeof (struct _X) != exp_sizeof_##_X ) \
+ abort(); \
+}
+
+#define check_struct_off(_X) \
+{ \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+#define check_union_size(_X) \
+{ \
+ if (sizeof (union _X) != exp_sizeof_##_X ) \
+ abort(); \
+}
+
+#define check_union_off(_X) \
+{ \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+int main(){
+
+ unsigned char filler[16];
+ struct one test_one;
+ struct two test_two;
+ struct three test_three;
+ struct four test_four;
+ struct five test_five;
+ struct six test_six;
+ struct seven test_seven;
+ struct eight test_eight;
+ union nine test_nine;
+ struct ten test_ten;
+
+#if defined (_TEST_MS_LAYOUT) || defined (_MSC_VER)
+ size_t exp_sizeof_one = 12;
+ size_t exp_sizeof_two = 16;
+ size_t exp_sizeof_three =6;
+ size_t exp_sizeof_four = 8;
+ size_t exp_sizeof_five = 3;
+ size_t exp_sizeof_six = 8;
+ size_t exp_sizeof_seven = 3;
+ size_t exp_sizeof_eight = 4;
+ size_t exp_sizeof_nine = 8;
+ size_t exp_sizeof_ten = 16;
+
+ unsigned char exp_one_c = 8;
+ unsigned char exp_two_c = 12;
+ unsigned char exp_three_c = 4;
+ unsigned char exp_four_c = 4;
+ char exp_five_c = 2;
+ char exp_six_c = 5;
+ char exp_seven_c = 2;
+ char exp_eight_c = 2;
+ char exp_nine_c = 0;
+ char exp_ten_c = 8;
+
+#else /* testing -mno-ms-bitfields */
+
+ size_t exp_sizeof_one = 8;
+ size_t exp_sizeof_two = 8;
+ size_t exp_sizeof_three = 6;
+ size_t exp_sizeof_four = 6;
+ size_t exp_sizeof_five = 6;
+ size_t exp_sizeof_six = 6;
+ size_t exp_sizeof_seven = 6;
+ size_t exp_sizeof_eight = 2;
+ size_t exp_sizeof_nine = 8;
+ size_t exp_sizeof_ten = 8;
+
+ unsigned short exp_one_c = 6;
+ unsigned int exp_two_c = 6;
+ unsigned char exp_three_c = 64;
+ unsigned char exp_four_c = 4;
+ char exp_five_c = 5;
+ char exp_six_c = 5;
+ char exp_seven_c = 5;
+ char exp_eight_c = 1;
+ char exp_nine_c = 0;
+ char exp_ten_c = 1;
+
+#endif
+
+ unsigned char i;
+ for ( i = 0; i < 16; i++ )
+ filler[i] = i;
+
+ check_struct_off (one);
+ check_struct_off (two);
+ check_struct_off (three);
+ check_struct_off (four);
+ check_struct_off (five);
+ check_struct_off (six);
+ check_struct_off (seven);
+ check_struct_off (eight);
+ check_union_off (nine);
+ check_struct_off (ten);
+
+ check_struct_size (one);
+ check_struct_size (two);
+ check_struct_size (three);
+ check_struct_size (four);
+ check_struct_size (five);
+ check_struct_size (six);
+ check_struct_size (seven);
+ check_struct_size (eight);
+ check_union_size (nine);
+ check_struct_size (ten);
+
+ return 0;
+};
+
diff --git a/gcc/testsuite/gcc.dg/bf-no-ms-layout.c b/gcc/testsuite/gcc.dg/bf-no-ms-layout.c
new file mode 100644
index 00000000000..a14f48d06cd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/bf-no-ms-layout.c
@@ -0,0 +1,232 @@
+/* bf-no-ms-layout.c */
+
+/* Test for gcc bitfield layout, with -mno-ms-bitfields */
+/* Adapted from Donn Terry <donnte@microsoft.com> testcase
+ posted to GCC-patches
+ http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00577.html */
+
+/* { dg-do run { target *-*-interix* } } */
+/* { dg-options "-mno-ms-bitfields" } */
+
+#include <stddef.h>
+#include <string.h>
+
+extern void abort();
+
+#pragma pack(8)
+
+struct one {
+ int d;
+ unsigned char a;
+ unsigned short b:7;
+ char c;
+};
+
+struct two {
+ int d;
+ unsigned char a;
+ unsigned int b:7;
+ char c;
+};
+
+struct three {
+ short d;
+ unsigned short a:3;
+ unsigned short b:9;
+ unsigned char c:7;
+};
+
+
+/* Bitfields of size 0 have some truly odd behaviors. */
+
+struct four {
+ unsigned short a:3;
+ unsigned short b:9;
+ unsigned int :0; /* forces struct alignment to int */
+ unsigned char c:7;
+};
+
+struct five {
+ char a;
+ int :0; /* ignored; prior field is not a bitfield. */
+ char b;
+ char c;
+};
+
+struct six {
+ char a :8;
+ int :0; /* not ignored; prior field IS a bitfield, causes
+ struct alignment as well. */
+ char b;
+ char c;
+} ;
+
+struct seven {
+ char a:8;
+ char :0;
+ int :0; /* Ignored; prior field is zero size bitfield. */
+ char b;
+ char c;
+};
+
+struct eight { /* ms size 4 */
+ short b:3;
+ char c;
+};
+
+#ifdef _MSC_VER
+#define LONGLONG __int64
+#else
+#define LONGLONG long long
+#endif
+
+union nine { /* ms size 8 */
+ LONGLONG a:3;
+ char c;
+};
+
+struct ten { /* ms size 16 */
+ LONGLONG a:3;
+ LONGLONG b:3;
+ char c;
+};
+
+
+#define val(s,f) (s.f)
+
+#define check_struct(_X) \
+{ \
+ if (sizeof (struct _X) != exp_sizeof_##_X ) \
+ abort(); \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+#define check_union(_X) \
+{ \
+ if (sizeof (union _X) != exp_sizeof_##_X ) \
+ abort(); \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+#define check_struct_size(_X) \
+{ \
+ if (sizeof (struct _X) != exp_sizeof_##_X ) \
+ abort(); \
+}
+
+#define check_struct_off(_X) \
+{ \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+#define check_union_size(_X) \
+{ \
+ if (sizeof (union _X) != exp_sizeof_##_X ) \
+ abort(); \
+}
+
+#define check_union_off(_X) \
+{ \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+int main(){
+
+ unsigned char filler[16];
+ struct one test_one;
+ struct two test_two;
+ struct three test_three;
+ struct four test_four;
+ struct five test_five;
+ struct six test_six;
+ struct seven test_seven;
+ struct eight test_eight;
+ union nine test_nine;
+ struct ten test_ten;
+
+#if defined (_TEST_MS_LAYOUT) || defined (_MSC_VER)
+ size_t exp_sizeof_one = 12;
+ size_t exp_sizeof_two = 16;
+ size_t exp_sizeof_three =6;
+ size_t exp_sizeof_four = 8;
+ size_t exp_sizeof_five = 3;
+ size_t exp_sizeof_six = 8;
+ size_t exp_sizeof_seven = 3;
+ size_t exp_sizeof_eight = 4;
+ size_t exp_sizeof_nine = 8;
+ size_t exp_sizeof_ten = 16;
+
+ unsigned char exp_one_c = 8;
+ unsigned char exp_two_c = 12;
+ unsigned char exp_three_c = 4;
+ unsigned char exp_four_c = 4;
+ char exp_five_c = 2;
+ char exp_six_c = 5;
+ char exp_seven_c = 2;
+ char exp_eight_c = 2;
+ char exp_nine_c = 0;
+ char exp_ten_c = 8;
+
+#else /* testing -mno-ms-bitfields */
+
+ size_t exp_sizeof_one = 8;
+ size_t exp_sizeof_two = 8;
+ size_t exp_sizeof_three = 6;
+ size_t exp_sizeof_four = 6;
+ size_t exp_sizeof_five = 6;
+ size_t exp_sizeof_six = 6;
+ size_t exp_sizeof_seven = 6;
+ size_t exp_sizeof_eight = 2;
+ size_t exp_sizeof_nine = 8;
+ size_t exp_sizeof_ten = 8;
+
+ unsigned short exp_one_c = 6;
+ unsigned int exp_two_c = 6;
+ unsigned char exp_three_c = 64;
+ unsigned char exp_four_c = 4;
+ char exp_five_c = 5;
+ char exp_six_c = 5;
+ char exp_seven_c = 5;
+ char exp_eight_c = 1;
+ char exp_nine_c = 0;
+ char exp_ten_c = 1;
+
+#endif
+
+ unsigned char i;
+ for ( i = 0; i < 16; i++ )
+ filler[i] = i;
+
+ check_struct_off (one);
+ check_struct_off (two);
+ check_struct_off (three);
+ check_struct_off (four);
+ check_struct_off (five);
+ check_struct_off (six);
+ check_struct_off (seven);
+ check_struct_off (eight);
+ check_union_off (nine);
+ check_struct_off (ten);
+
+ check_struct_size (one);
+ check_struct_size (two);
+ check_struct_size (three);
+ check_struct_size (four);
+ check_struct_size (five);
+ check_struct_size (six);
+ check_struct_size (seven);
+ check_struct_size (eight);
+ check_union_size (nine);
+ check_struct_size (ten);
+
+ return 0;
+};
+
diff --git a/gcc/testsuite/gcc.dg/builtins-2.c b/gcc/testsuite/gcc.dg/builtins-2.c
new file mode 100644
index 00000000000..68ef67e297b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtins-2.c
@@ -0,0 +1,146 @@
+/* Copyright (C) 2002 Free Software Foundation.
+
+ Verify that built-in math function constant folding doesn't
+ cause any problems for the compiler.
+
+ Written by Roger Sayle, 16th August 2002. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+double test1(double x)
+{
+ return log(exp(x));
+}
+
+double test2(double x)
+{
+ return exp(log(x));
+}
+
+double test3(double x)
+{
+ return sqrt(exp(x));
+}
+
+double test4(double x)
+{
+ return log(sqrt(x));
+}
+
+double test5(double x, double y)
+{
+ return sqrt(x)*sqrt(y);
+}
+
+double test6(double x, double y)
+{
+ return exp(x)*exp(y);
+}
+
+double test7(double x, double y)
+{
+ return x/exp(y);
+}
+
+double test8(double x)
+{
+ return fabs(sqrt(x));
+}
+
+double test9(double x)
+{
+ return fabs(exp(x));
+}
+
+float test1f(float x)
+{
+ return logf(expf(x));
+}
+
+float test2f(float x)
+{
+ return expf(logf(x));
+}
+
+float test3f(float x)
+{
+ return sqrtf(expf(x));
+}
+
+float test4f(float x)
+{
+ return logf(sqrtf(x));
+}
+
+float test5f(float x, float y)
+{
+ return sqrtf(x)*sqrtf(y);
+}
+
+float test6f(float x, float y)
+{
+ return expf(x)*expf(y);
+}
+
+float test7f(float x, float y)
+{
+ return x/expf(y);
+}
+
+float test8f(float x)
+{
+ return fabsf(sqrtf(x));
+}
+
+float test9f(float x)
+{
+ return fabsf(expf(x));
+}
+
+long double test1l(long double x)
+{
+ return logl(expl(x));
+}
+
+long double test2l(long double x)
+{
+ return expl(logl(x));
+}
+
+long double test3l(long double x)
+{
+ return sqrtl(expl(x));
+}
+
+long double test4l(long double x)
+{
+ return logl(sqrtl(x));
+}
+
+long double test5l(long double x, long double y)
+{
+ return sqrtl(x)*sqrtl(y);
+}
+
+long double test6l(long double x, long double y)
+{
+ return expl(x)*expl(y);
+}
+
+long double test7l(long double x, long double y)
+{
+ return x/expl(y);
+}
+
+long double test8l(long double x)
+{
+ return fabsl(sqrtl(x));
+}
+
+long double test9l(long double x)
+{
+ return fabsl(expl(x));
+}
+
+
diff --git a/gcc/testsuite/gcc.dg/builtins-3.c b/gcc/testsuite/gcc.dg/builtins-3.c
new file mode 100644
index 00000000000..49bea5e126e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtins-3.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2002 Free Software Foundation.
+
+ Verify that built-in math function constant folding of constant
+ arguments is correctly performed by the by the compiler.
+
+ Written by Roger Sayle, 16th August 2002. */
+
+/* { dg-do link } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern void link_error(void);
+
+int main()
+{
+ if (sqrt (0.0) != 0.0)
+ link_error ();
+
+ if (sqrt (1.0) != 1.0)
+ link_error ();
+
+ if (exp (0.0) != 1.0)
+ link_error ();
+
+ if (log (1.0) != 0.0)
+ link_error ();
+
+
+ if (sqrtf (0.0f) != 0.0f)
+ link_error ();
+
+ if (sqrtf (1.0f) != 1.0f)
+ link_error ();
+
+ if (expf (0.0f) != 1.0f)
+ link_error ();
+
+ if (logf (1.0f) != 0.0f)
+ link_error ();
+
+
+ if (sqrtl (0.0l) != 0.0l)
+ link_error ();
+
+ if (sqrtl (1.0l) != 1.0l)
+ link_error ();
+
+ if (expl (0.0l) != 1.0l)
+ link_error ();
+
+ if (logl (1.0l) != 0.0l)
+ link_error ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/i386-bitfield1.c b/gcc/testsuite/gcc.dg/i386-bitfield1.c
index 8045a677e6c..26154f57d11 100644
--- a/gcc/testsuite/gcc.dg/i386-bitfield1.c
+++ b/gcc/testsuite/gcc.dg/i386-bitfield1.c
@@ -1,6 +1,7 @@
// Test for bitfield alignment in structs on IA-32
// { dg-do run { target i?86-*-* } }
// { dg-options "-O2" }
+// { dg-options "-mno-align-double -mno-ms-bitfields" { target *-*-interix* } }
extern void abort (void);
extern void exit (int);
diff --git a/gcc/testsuite/gcc.dg/i386-cmov1.c b/gcc/testsuite/gcc.dg/i386-cmov1.c
new file mode 100644
index 00000000000..1f7ff727bc4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/i386-cmov1.c
@@ -0,0 +1,29 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -march=athlon" } */
+/* { dg-final { scan-assembler "sar.*magic_namea" } } */
+/* { dg-final { scan-assembler "sar.*magic_nameb" } } */
+/* { dg-final { scan-assembler "sar.*magic_namec" } } */
+/* { dg-final { scan-assembler "shr.*magic_named" } } */
+/* { dg-final { scan-assembler "shr.*magic_namee" } } */
+/* { dg-final { scan-assembler "shr.*magic_namef" } } */
+
+/* Check code generation for several conditional moves doable by single arithmetics. */
+
+int magic_namea;
+char magic_nameb;
+short magic_namec;
+int magic_named;
+char magic_namee;
+short magic_namef;
+
+unsigned int gen;
+m()
+{
+ magic_namec=magic_namec>=0?0:-1;
+ magic_namea=magic_namea>=0?0:-1;
+ magic_nameb=magic_nameb>=0?0:-1;
+ magic_named=magic_named>=0?0:1;
+ magic_namee=magic_namee>=0?0:1;
+ magic_namef=magic_namef>=0?0:1;
+}
+
diff --git a/gcc/testsuite/gcc.dg/i386-cmov2.c b/gcc/testsuite/gcc.dg/i386-cmov2.c
new file mode 100644
index 00000000000..f4edfbf64c0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/i386-cmov2.c
@@ -0,0 +1,9 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -march=athlon" } */
+/* { dg-final { scan-assembler "sbb" } } */
+
+/* This conditional move is fastest to be done using sbb. */
+t(unsigned int a, unsigned int b)
+{
+ return (a<=b?5:-5);
+}
diff --git a/gcc/testsuite/gcc.dg/i386-cmov3.c b/gcc/testsuite/gcc.dg/i386-cmov3.c
new file mode 100644
index 00000000000..9e5a6361e52
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/i386-cmov3.c
@@ -0,0 +1,9 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -march=athlon" } */
+/* { dg-final { scan-assembler "cmov" } } */
+
+/* This conditional move is fastest to be done using cmov. */
+t(int a, int b)
+{
+ return (a<=b?5:-5);
+}
diff --git a/gcc/testsuite/gcc.dg/i386-ssefp-1.c b/gcc/testsuite/gcc.dg/i386-ssefp-1.c
new file mode 100644
index 00000000000..ad6f109bc99
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/i386-ssefp-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -msse2 -march=athlon -mfpmath=sse" } */
+/* { dg-final { scan-assembler "maxsd" } } */
+/* { dg-final { scan-assembler "minsd" } } */
+double x;
+t()
+{
+ x=x>5?x:5;
+}
+
+double x;
+q()
+{
+ x=x<5?x:5;
+}
diff --git a/gcc/testsuite/gcc.dg/i386-ssefp-2.c b/gcc/testsuite/gcc.dg/i386-ssefp-2.c
new file mode 100644
index 00000000000..0d1ced2fee0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/i386-ssefp-2.c
@@ -0,0 +1,15 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -msse2 -march=athlon -mfpmath=sse" } */
+/* { dg-final { scan-assembler "maxsd" } } */
+/* { dg-final { scan-assembler "minsd" } } */
+double x;
+q()
+{
+ x=x<5?5:x;
+}
+
+double x;
+q1()
+{
+ x=x>5?5:x;
+}
diff --git a/gcc/testsuite/gcc.dg/sibcall-5.c b/gcc/testsuite/gcc.dg/sibcall-5.c
new file mode 100644
index 00000000000..424908dba5a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/sibcall-5.c
@@ -0,0 +1,41 @@
+/* Check that indirect sibcalls understand regparm. */
+/* { dg-do run { target i?86-*-* } } */
+/* { dg-options "-O2" } */
+
+int (*f)(int, int) __attribute__((regparm(2)));
+int (*g)(int, int, int) __attribute__((regparm(3)));
+
+int __attribute__((noinline))
+foo(void)
+{
+ return f(1, 2);
+}
+
+int __attribute__((noinline))
+bar(void)
+{
+ return g(1, 2, 3);
+}
+
+int __attribute__((regparm(2)))
+f1(int x, int y)
+{
+ return x*3 + y;
+}
+
+int __attribute__((regparm(3)))
+g1(int x, int y, int z)
+{
+ return x*9 + y*3 + z;
+}
+
+int main()
+{
+ f = f1;
+ g = g1;
+ if (foo() != 1*3 + 2)
+ abort ();
+ if (bar() != 1*9 + 2*3 + 3)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/sibcall-6.c b/gcc/testsuite/gcc.dg/sibcall-6.c
new file mode 100644
index 00000000000..771a14e8b56
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/sibcall-6.c
@@ -0,0 +1,42 @@
+/* A simple check to see whether indirect calls are
+ being sibcall optimized on targets that do support
+ this notion, i.e. have the according call patterns
+ in place.
+
+ Copyright (C) 2002 Free Software Foundation Inc.
+ Contributed by Andreas Bauer <baueran@in.tum.de> */
+
+/* { dg-do run { target i?86-*-* x86_64-*-*} } */
+/* { dg-options "-O2 -foptimize-sibling-calls" } */
+
+int foo (int);
+int bar (int);
+
+int (*ptr) (int);
+int *f_addr;
+
+int
+main ()
+{
+ ptr = bar;
+ foo (7);
+ exit (0);
+}
+
+int
+bar (b)
+ int b;
+{
+ if (f_addr == (int*) __builtin_return_address (0))
+ return b;
+ else
+ abort ();
+}
+
+int
+foo (f)
+ int f;
+{
+ f_addr = (int*) __builtin_return_address (0);
+ return (*ptr)(f);
+}
diff --git a/gcc/timevar.c b/gcc/timevar.c
index 7a10fe78b47..3697a5a2ed8 100644
--- a/gcc/timevar.c
+++ b/gcc/timevar.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "intl.h"
#include "rtl.h"
@@ -100,13 +102,13 @@ extern clock_t clock PARAMS ((void));
precompute them. Whose wonderful idea was it to make all those
_constants_ variable at run time, anyway? */
#ifdef USE_TIMES
-static float ticks_to_msec;
-#define TICKS_TO_MSEC (1 / (float)TICKS_PER_SECOND)
+static double ticks_to_msec;
+#define TICKS_TO_MSEC (1 / (double)TICKS_PER_SECOND)
#endif
#ifdef USE_CLOCK
-static float clocks_to_msec;
-#define CLOCKS_TO_MSEC (1 / (float)CLOCKS_PER_SEC)
+static double clocks_to_msec;
+#define CLOCKS_TO_MSEC (1 / (double)CLOCKS_PER_SEC)
#endif
#include "flags.h"
@@ -449,7 +451,7 @@ timevar_print (fp)
for (id = 0; id < (unsigned int) TIMEVAR_LAST; ++id)
{
struct timevar_def *tv = &timevars[(timevar_id_t) id];
- const float tiny = 5e-3;
+ const double tiny = 5e-3;
/* Don't print the total execution time here; that goes at the
end. */
diff --git a/gcc/timevar.h b/gcc/timevar.h
index 149751c3467..ac01a2994a5 100644
--- a/gcc/timevar.h
+++ b/gcc/timevar.h
@@ -53,14 +53,14 @@
struct timevar_time_def
{
/* User time in this process. */
- float user;
+ double user;
/* System time (if applicable for this host platform) in this
process. */
- float sys;
+ double sys;
/* Wall clock time. */
- float wall;
+ double wall;
};
/* An enumeration of timing variable identifiers. Constructed from
diff --git a/gcc/tlink.c b/gcc/tlink.c
index b4a724e1946..ea1ce3a4db1 100644
--- a/gcc/tlink.c
+++ b/gcc/tlink.c
@@ -23,6 +23,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "intl.h"
#include "obstack.h"
#include "hashtab.h"
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 0c06857e55a..d98405b23e4 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -28,6 +28,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#undef FLOAT /* This is for hpux. They should change hpux. */
#undef FFS /* Some systems define this in param.h. */
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include <signal.h>
#ifdef HAVE_SYS_RESOURCE_H
@@ -2156,14 +2158,11 @@ compile_file ()
wrapup_global_declarations (vec, len);
- /* This must occur after the loop to output deferred functions. Else
- the profiler initializer would not be emitted if all the functions
- in this compilation unit were deferred.
-
- output_func_start_profiler can not cause any additional functions or
- data to need to be output, so it need not be in the deferred function
- loop above. */
- output_func_start_profiler ();
+ if (profile_arc_flag)
+ /* This must occur after the loop to output deferred functions.
+ Else the profiler initializer would not be emitted if all the
+ functions in this compilation unit were deferred. */
+ create_profiler ();
check_global_declarations (vec, len);
@@ -2190,8 +2189,6 @@ compile_file ()
dw2_output_indirect_constants ();
- end_final (aux_base_name);
-
if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
{
timevar_push (TV_DUMP);
diff --git a/gcc/tracer.c b/gcc/tracer.c
index 970b5f46b40..de231e860da 100644
--- a/gcc/tracer.c
+++ b/gcc/tracer.c
@@ -35,6 +35,8 @@
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "hard-reg-set.h"
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c
index 5b9f4f58ab6..b840611489d 100644
--- a/gcc/tree-dump.c
+++ b/gcc/tree-dump.c
@@ -21,6 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "splay-tree.h"
#include "diagnostic.h"
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 0f5ab59158f..dfb19356bfc 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "toplev.h"
#include "tree.h"
#include "tree-inline.h"
@@ -88,8 +90,6 @@ typedef struct inline_data
/* Nonzero if we are currently within the cleanup for a
TARGET_EXPR. */
int in_target_cleanup_p;
- /* A stack of the TARGET_EXPRs that we are currently processing. */
- varray_type target_exprs;
/* A list of the functions current function has inlined. */
varray_type inlined_fns;
/* The approximate number of statements we have inlined in the
@@ -107,7 +107,7 @@ typedef struct inline_data
/* Prototypes. */
-static tree declare_return_variable PARAMS ((inline_data *, tree *));
+static tree declare_return_variable PARAMS ((inline_data *, tree, tree *));
static tree copy_body_r PARAMS ((tree *, int *, void *));
static tree copy_body PARAMS ((inline_data *));
static tree expand_call_inline PARAMS ((tree *, int *, void *));
@@ -789,13 +789,15 @@ initialize_inlined_parameters (id, args, fn, block)
#ifndef INLINER_FOR_JAVA
static tree
-declare_return_variable (id, use_stmt)
+declare_return_variable (id, return_slot_addr, use_stmt)
struct inline_data *id;
+ tree return_slot_addr;
tree *use_stmt;
#else /* INLINER_FOR_JAVA */
static tree
-declare_return_variable (id, var)
+declare_return_variable (id, return_slot_addr, var)
struct inline_data *id;
+ tree return_slot_addr;
tree *var;
#endif /* INLINER_FOR_JAVA */
{
@@ -821,7 +823,7 @@ declare_return_variable (id, var)
#ifndef INLINER_FOR_JAVA
var = ((*lang_hooks.tree_inlining.copy_res_decl_for_inlining)
(result, fn, VARRAY_TREE (id->fns, 0), id->decl_map,
- &need_return_decl, &id->target_exprs));
+ &need_return_decl, return_slot_addr));
/* Register the VAR_DECL as the equivalent for the RESULT_DECL; that
way, when the RESULT_DECL is encountered, it will be
@@ -847,7 +849,7 @@ declare_return_variable (id, var)
#else /* INLINER_FOR_JAVA */
*var = ((*lang_hooks.tree_inlining.copy_res_decl_for_inlining)
(result, fn, VARRAY_TREE (id->fns, 0), id->decl_map,
- &need_return_decl, NULL_TREE));
+ &need_return_decl, return_slot_addr));
splay_tree_insert (id->decl_map,
(splay_tree_key) result,
@@ -1035,6 +1037,8 @@ expand_call_inline (tp, walk_subtrees, data)
tree arg_inits;
tree *inlined_body;
splay_tree st;
+ tree args;
+ tree return_slot_addr;
/* See what we've got. */
id = (inline_data *) data;
@@ -1050,9 +1054,6 @@ expand_call_inline (tp, walk_subtrees, data)
/* We're walking our own subtrees. */
*walk_subtrees = 0;
- /* Push *TP on the stack of pending TARGET_EXPRs. */
- VARRAY_PUSH_TREE (id->target_exprs, *tp);
-
/* Actually walk over them. This loop is the body of
walk_trees, omitting the case where the TARGET_EXPR
itself is handled. */
@@ -1066,9 +1067,6 @@ expand_call_inline (tp, walk_subtrees, data)
--id->in_target_cleanup_p;
}
- /* We're done with this TARGET_EXPR now. */
- VARRAY_POP (id->target_exprs);
-
return NULL_TREE;
#else /* INLINER_FOR_JAVA */
abort ();
@@ -1144,8 +1142,16 @@ expand_call_inline (tp, walk_subtrees, data)
NULL, NULL);
/* Initialize the parameters. */
+ args = TREE_OPERAND (t, 1);
+ return_slot_addr = NULL_TREE;
+ if (CALL_EXPR_HAS_RETURN_SLOT_ADDR (t))
+ {
+ return_slot_addr = TREE_VALUE (args);
+ args = TREE_CHAIN (args);
+ }
+
#ifndef INLINER_FOR_JAVA
- arg_inits = initialize_inlined_parameters (id, TREE_OPERAND (t, 1), fn);
+ arg_inits = initialize_inlined_parameters (id, args, fn);
/* Expand any inlined calls in the initializers. Do this before we
push FN on the stack of functions we are inlining; we want to
inline calls to FN that appear in the initializers for the
@@ -1154,7 +1160,7 @@ expand_call_inline (tp, walk_subtrees, data)
/* And add them to the tree. */
COMPOUND_BODY (stmt) = chainon (COMPOUND_BODY (stmt), arg_inits);
#else /* INLINER_FOR_JAVA */
- arg_inits = initialize_inlined_parameters (id, TREE_OPERAND (t, 1), fn, expr);
+ arg_inits = initialize_inlined_parameters (id, args, fn, expr);
if (arg_inits)
{
/* Expand any inlined calls in the initializers. Do this before we
@@ -1215,11 +1221,11 @@ expand_call_inline (tp, walk_subtrees, data)
/* Declare the return variable for the function. */
COMPOUND_BODY (stmt)
= chainon (COMPOUND_BODY (stmt),
- declare_return_variable (id, &use_stmt));
+ declare_return_variable (id, return_slot_addr, &use_stmt));
#else /* INLINER_FOR_JAVA */
{
/* Declare the return variable for the function. */
- tree decl = declare_return_variable (id, &retvar);
+ tree decl = declare_return_variable (id, return_slot_addr, &retvar);
if (retvar)
{
tree *next = &BLOCK_VARS (expr);
@@ -1387,9 +1393,6 @@ optimize_inline_calls (fn)
prev_fn = ((*lang_hooks.tree_inlining.add_pending_fn_decls)
(&id.fns, prev_fn));
- /* Create the stack of TARGET_EXPRs. */
- VARRAY_TREE_INIT (id.target_exprs, 32, "target_exprs");
-
/* Create the list of functions this call will inline. */
VARRAY_TREE_INIT (id.inlined_fns, 32, "inlined_fns");
diff --git a/gcc/tree.c b/gcc/tree.c
index 04fddb26dd3..1bfb66bf6d2 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -31,6 +31,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "flags.h"
#include "tree.h"
#include "real.h"
@@ -723,6 +725,24 @@ integer_pow2p (expr)
|| (low == 0 && (high & (high - 1)) == 0));
}
+/* Return 1 if EXPR is an integer constant other than zero or a
+ complex constant other than zero. */
+
+int
+integer_nonzerop (expr)
+ tree expr;
+{
+ STRIP_NOPS (expr);
+
+ return ((TREE_CODE (expr) == INTEGER_CST
+ && ! TREE_CONSTANT_OVERFLOW (expr)
+ && (TREE_INT_CST_LOW (expr) != 0
+ || TREE_INT_CST_HIGH (expr) != 0))
+ || (TREE_CODE (expr) == COMPLEX_CST
+ && (integer_nonzerop (TREE_REALPART (expr))
+ || integer_nonzerop (TREE_IMAGPART (expr)))));
+}
+
/* Return the power of two represented by a tree node known to be a
power of two. */
@@ -944,41 +964,6 @@ chain_member (elem, chain)
return 0;
}
-/* Return nonzero if ELEM is equal to TREE_VALUE (CHAIN) for any piece of
- chain CHAIN. This and the next function are currently unused, but
- are retained for completeness. */
-
-int
-chain_member_value (elem, chain)
- tree elem, chain;
-{
- while (chain)
- {
- if (elem == TREE_VALUE (chain))
- return 1;
- chain = TREE_CHAIN (chain);
- }
-
- return 0;
-}
-
-/* Return nonzero if ELEM is equal to TREE_PURPOSE (CHAIN)
- for any piece of chain CHAIN. */
-
-int
-chain_member_purpose (elem, chain)
- tree elem, chain;
-{
- while (chain)
- {
- if (elem == TREE_PURPOSE (chain))
- return 1;
- chain = TREE_CHAIN (chain);
- }
-
- return 0;
-}
-
/* Return the length of a chain of nodes chained through TREE_CHAIN.
We expect a null pointer to mark the end of the chain.
This is the Lisp primitive `length'. */
@@ -1071,31 +1056,6 @@ nreverse (t)
}
return prev;
}
-
-/* Given a chain CHAIN of tree nodes,
- construct and return a list of those nodes. */
-
-tree
-listify (chain)
- tree chain;
-{
- tree result = NULL_TREE;
- tree in_tail = chain;
- tree out_tail = NULL_TREE;
-
- while (in_tail)
- {
- tree next = tree_cons (NULL_TREE, in_tail, NULL_TREE);
- if (out_tail)
- TREE_CHAIN (out_tail) = next;
- else
- result = next;
- out_tail = next;
- in_tail = TREE_CHAIN (in_tail);
- }
-
- return result;
-}
/* Return a newly created TREE_LIST node whose
purpose and value fields are PARM and VALUE. */
@@ -3228,24 +3188,6 @@ tree_low_cst (t, pos)
abort ();
}
-/* Return the most significant bit of the integer constant T. */
-
-int
-tree_int_cst_msb (t)
- tree t;
-{
- int prec;
- HOST_WIDE_INT h;
- unsigned HOST_WIDE_INT l;
-
- /* Note that using TYPE_PRECISION here is wrong. We care about the
- actual bits, not the (arbitrary) range of the type. */
- prec = GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (t))) - 1;
- rshift_double (TREE_INT_CST_LOW (t), TREE_INT_CST_HIGH (t), prec,
- 2 * HOST_BITS_PER_WIDE_INT, &l, &h, 0);
- return (l & 1) == 1;
-}
-
/* Return an indication of the sign of the integer constant T.
The return value is -1 if T < 0, 0 if T == 0, and 1 if T > 0.
Note that -1 will never be returned it T's type is unsigned. */
@@ -3449,26 +3391,28 @@ compare_tree_int (t, u)
(RECORD_TYPE, UNION_TYPE and ENUMERAL_TYPE nodes are
constructed by language-dependent code, not here.) */
-/* Construct, lay out and return the type of pointers to TO_TYPE.
- If such a type has already been constructed, reuse it. */
+/* Construct, lay out and return the type of pointers to TO_TYPE
+ with mode MODE. If such a type has already been constructed,
+ reuse it. */
tree
-build_pointer_type (to_type)
+build_pointer_type_for_mode (to_type, mode)
tree to_type;
+ enum machine_mode mode;
{
tree t = TYPE_POINTER_TO (to_type);
/* First, if we already have a type for pointers to TO_TYPE, use it. */
-
- if (t != 0)
+ if (t != 0 && mode == ptr_mode)
return t;
- /* We need a new one. */
t = make_node (POINTER_TYPE);
TREE_TYPE (t) = to_type;
+ TYPE_MODE (t) = mode;
/* Record this type as the pointer to TO_TYPE. */
+ if (mode == ptr_mode)
TYPE_POINTER_TO (to_type) = t;
/* Lay out the type. This function has many callers that are concerned
@@ -3479,25 +3423,37 @@ build_pointer_type (to_type)
return t;
}
-/* Build the node for the type of references-to-TO_TYPE. */
+/* By default build pointers in ptr_mode. */
tree
-build_reference_type (to_type)
+build_pointer_type (to_type)
+ tree to_type;
+{
+ return build_pointer_type_for_mode (to_type, ptr_mode);
+}
+
+/* Construct, lay out and return the type of references to TO_TYPE
+ with mode MODE. If such a type has already been constructed,
+ reuse it. */
+
+tree
+build_reference_type_for_mode (to_type, mode)
tree to_type;
+ enum machine_mode mode;
{
tree t = TYPE_REFERENCE_TO (to_type);
/* First, if we already have a type for pointers to TO_TYPE, use it. */
-
- if (t)
+ if (t != 0 && mode == ptr_mode)
return t;
- /* We need a new one. */
t = make_node (REFERENCE_TYPE);
TREE_TYPE (t) = to_type;
+ TYPE_MODE (t) = mode;
/* Record this type as the pointer to TO_TYPE. */
+ if (mode == ptr_mode)
TYPE_REFERENCE_TO (to_type) = t;
layout_type (t);
@@ -3505,6 +3461,17 @@ build_reference_type (to_type)
return t;
}
+
+/* Build the node for the type of references-to-TO_TYPE by default
+ in ptr_mode. */
+
+tree
+build_reference_type (to_type)
+ tree to_type;
+{
+ return build_reference_type_for_mode (to_type, ptr_mode);
+}
+
/* Build a type that is compatible with t but has no cv quals anywhere
in its type, thus
@@ -3599,36 +3566,6 @@ build_index_2_type (lowval, highval)
return build_range_type (sizetype, lowval, highval);
}
-/* Return nonzero iff ITYPE1 and ITYPE2 are equal (in the LISP sense).
- Needed because when index types are not hashed, equal index types
- built at different times appear distinct, even though structurally,
- they are not. */
-
-int
-index_type_equal (itype1, itype2)
- tree itype1, itype2;
-{
- if (TREE_CODE (itype1) != TREE_CODE (itype2))
- return 0;
-
- if (TREE_CODE (itype1) == INTEGER_TYPE)
- {
- if (TYPE_PRECISION (itype1) != TYPE_PRECISION (itype2)
- || TYPE_MODE (itype1) != TYPE_MODE (itype2)
- || simple_cst_equal (TYPE_SIZE (itype1), TYPE_SIZE (itype2)) != 1
- || TYPE_ALIGN (itype1) != TYPE_ALIGN (itype2))
- return 0;
-
- if (1 == simple_cst_equal (TYPE_MIN_VALUE (itype1),
- TYPE_MIN_VALUE (itype2))
- && 1 == simple_cst_equal (TYPE_MAX_VALUE (itype1),
- TYPE_MAX_VALUE (itype2)))
- return 1;
- }
-
- return 0;
-}
-
/* Construct, lay out and return the type of arrays of elements with ELT_TYPE
and number of elements specified by the range of values of INDEX_TYPE.
If such a type has already been constructed, reuse it. */
diff --git a/gcc/tree.h b/gcc/tree.h
index 36e7fd4eeb3..0b99b4037a2 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -202,6 +202,8 @@ struct tree_common GTY(())
TREE_LIST or TREE_VEC
TREE_PRIVATE in
..._DECL
+ CALL_EXPR_HAS_RETURN_SLOT_ADDR in
+ CALL_EXPR
protected_flag:
@@ -638,6 +640,10 @@ extern void tree_vec_elt_check_failed PARAMS ((int, int, const char *,
an exception. In a CALL_EXPR, nonzero means the call cannot throw. */
#define TREE_NOTHROW(NODE) ((NODE)->common.nothrow_flag)
+/* In a CALL_EXPR, means that the address of the return slot is part of the
+ argument list. */
+#define CALL_EXPR_HAS_RETURN_SLOT_ADDR(NODE) ((NODE)->common.private_flag)
+
/* In a type, nonzero means that all objects of the type are guaranteed by the
language or front-end to be properly aligned, so we can indicate that a MEM
of this type is aligned at least to the alignment of the type, even if it
@@ -2247,7 +2253,9 @@ extern tree make_unsigned_type PARAMS ((int));
extern void initialize_sizetypes PARAMS ((void));
extern void set_sizetype PARAMS ((tree));
extern void fixup_unsigned_type PARAMS ((tree));
+extern tree build_pointer_type_for_mode PARAMS ((tree, enum machine_mode));
extern tree build_pointer_type PARAMS ((tree));
+extern tree build_reference_type_for_mode PARAMS ((tree, enum machine_mode));
extern tree build_reference_type PARAMS ((tree));
extern tree build_type_no_quals PARAMS ((tree));
extern tree build_index_type PARAMS ((tree));
@@ -2271,11 +2279,9 @@ extern int tree_int_cst_lt PARAMS ((tree, tree));
extern int tree_int_cst_compare PARAMS ((tree, tree));
extern int host_integerp PARAMS ((tree, int));
extern HOST_WIDE_INT tree_low_cst PARAMS ((tree, int));
-extern int tree_int_cst_msb PARAMS ((tree));
extern int tree_int_cst_sgn PARAMS ((tree));
extern int tree_expr_nonnegative_p PARAMS ((tree));
extern int rtl_expr_nonnegative_p PARAMS ((rtx));
-extern int index_type_equal PARAMS ((tree, tree));
extern tree get_inner_array_type PARAMS ((tree));
/* From expmed.c. Since rtl.h is included after tree.h, we can't
@@ -2427,6 +2433,12 @@ extern tree build_qualified_type PARAMS ((tree, int));
extern tree build_type_copy PARAMS ((tree));
+/* Finish up a builtin RECORD_TYPE. Give it a name and provide its
+ fields. Optionally specify an alignment, and then lsy it out. */
+
+extern void finish_builtin_struct PARAMS ((tree, const char *,
+ tree, tree));
+
/* Given a ..._TYPE node, calculate the TYPE_SIZE, TYPE_SIZE_UNIT,
TYPE_ALIGN and TYPE_MODE fields. If called more than once on one
node, does nothing except for the first time. */
@@ -2473,8 +2485,6 @@ extern void set_lang_adjust_rli PARAMS ((void (*) PARAMS
extern record_layout_info start_record_layout PARAMS ((tree));
extern tree bit_from_pos PARAMS ((tree, tree));
extern tree byte_from_pos PARAMS ((tree, tree));
-extern void pos_from_byte PARAMS ((tree *, tree *, unsigned int,
- tree));
extern void pos_from_bit PARAMS ((tree *, tree *, unsigned int,
tree));
extern void normalize_offset PARAMS ((tree *, tree *,
@@ -2629,6 +2639,11 @@ extern int integer_all_onesp PARAMS ((tree));
extern int integer_pow2p PARAMS ((tree));
+/* integer_nonzerop (tree x) is nonzero if X is an integer constant
+ with a nonzero value. */
+
+extern int integer_nonzerop PARAMS ((tree));
+
/* staticp (tree x) is nonzero if X is a reference to data allocated
at a fixed address in memory. */
@@ -2810,7 +2825,6 @@ extern tree lhd_unsave_expr_now PARAMS ((tree));
/* In stmt.c */
-extern int in_control_zone_p PARAMS ((void));
extern void expand_fixups PARAMS ((rtx));
extern tree expand_start_stmt_expr PARAMS ((int));
extern tree expand_end_stmt_expr PARAMS ((tree));
@@ -2867,7 +2881,6 @@ extern int pushcase_range PARAMS ((tree, tree,
tree (*) (tree, tree),
tree, tree *));
extern void using_eh_for_cleanups PARAMS ((void));
-extern int stmt_loop_nest_empty PARAMS ((void));
/* In fold-const.c */
@@ -2911,9 +2924,10 @@ extern void rrotate_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
extern int operand_equal_p PARAMS ((tree, tree, int));
extern tree invert_truthvalue PARAMS ((tree));
-extern tree fold_builtin PARAMS ((tree));
-
-extern tree build_range_type PARAMS ((tree, tree, tree));
+/* In builtins.c */
+extern tree fold_builtin PARAMS ((tree));
+extern enum built_in_function builtin_mathfn_code PARAMS ((tree));
+extern tree build_function_call_expr PARAMS ((tree, tree));
/* In alias.c */
extern void record_component_aliases PARAMS ((tree));
@@ -2936,9 +2950,6 @@ extern int compare_tree_int PARAMS ((tree,
unsigned HOST_WIDE_INT));
extern int type_list_equal PARAMS ((tree, tree));
extern int chain_member PARAMS ((tree, tree));
-extern int chain_member_purpose PARAMS ((tree, tree));
-extern int chain_member_value PARAMS ((tree, tree));
-extern tree listify PARAMS ((tree));
extern tree type_hash_lookup PARAMS ((unsigned int, tree));
extern void type_hash_add PARAMS ((unsigned int, tree));
extern unsigned int type_hash_list PARAMS ((tree));
@@ -2961,6 +2972,7 @@ extern void gcc_obstack_init PARAMS ((struct obstack *));
extern void init_ttree PARAMS ((void));
extern void build_common_tree_nodes PARAMS ((int));
extern void build_common_tree_nodes_2 PARAMS ((int));
+extern tree build_range_type PARAMS ((tree, tree, tree));
/* In function.c */
extern void setjmp_protect_args PARAMS ((void));
@@ -2987,7 +2999,6 @@ extern int aggregate_value_p PARAMS ((tree));
extern void free_temps_for_rtl_expr PARAMS ((tree));
extern void instantiate_virtual_regs PARAMS ((tree, rtx));
extern void unshare_all_rtl PARAMS ((tree, rtx));
-extern int max_parm_reg_num PARAMS ((void));
extern void push_function_context PARAMS ((void));
extern void pop_function_context PARAMS ((void));
extern void push_function_context_to PARAMS ((tree));
@@ -3074,7 +3085,6 @@ extern void expand_asm_operands PARAMS ((tree, tree, tree, tree, int,
const char *, int));
extern int any_pending_cleanups PARAMS ((int));
extern void init_stmt_for_function PARAMS ((void));
-extern int drop_through_at_end_p PARAMS ((void));
extern void expand_start_target_temps PARAMS ((void));
extern void expand_end_target_temps PARAMS ((void));
extern void expand_elseif PARAMS ((tree));
@@ -3083,10 +3093,7 @@ extern void expand_decl PARAMS ((tree));
extern int expand_decl_cleanup PARAMS ((tree, tree));
extern int expand_decl_cleanup_eh PARAMS ((tree, tree, int));
extern void expand_anon_union_decl PARAMS ((tree, tree, tree));
-extern void move_cleanups_up PARAMS ((void));
extern void expand_start_case_dummy PARAMS ((void));
-extern void expand_end_case_dummy PARAMS ((void));
-extern tree case_index_expr_type PARAMS ((void));
extern HOST_WIDE_INT all_cases_count PARAMS ((tree, int *));
extern void check_for_full_enumeration_handling PARAMS ((tree));
extern void declare_nonlocal_label PARAMS ((tree));
diff --git a/gcc/treelang/ChangeLog b/gcc/treelang/ChangeLog
index 138a96dd8fa..4e779012f63 100644
--- a/gcc/treelang/ChangeLog
+++ b/gcc/treelang/ChangeLog
@@ -1,11 +1,27 @@
+2002-11-30 Zack Weinberg <zack@codesourcery.com>
+
+ * lex.l: Move "%{" below copyright notice; get rid of "/*"
+ embedded in comment. Do not #undef IN_GCC; do not include
+ stdio.h, memory.h, or ansidecl.h; do not include config.h twice.
+ Do include coretypes.h and tm.h.
+ * parse.y: Do not #undef IN_GCC, provide bogus definitions of tree
+ and rtx typedefs, or include stdio.h, stdlib.h, string.h, or
+ ansidecl.h. Do include coretypes.h and tm.h.
+ * tree1.c: Do not include ansidecl.h, stdlib.h, unistd.h, ctype.h,
+ stdarg.h, string.h, or stdio.h. Do include coretypes.h and tm.h.
+ * treetree.c: Do not include stdlib.h, unistd.h, safe-ctype.h,
+ errno.h. stdarg.h, limits.h, string.h, fcntl.h, getopt.h. stdio.h,
+ or ansidecl.h. Do include coretypes.h and tm.h.
+ * Make-lang.in: Update dependencies.
+
2002-09-09 Tim Josling <tej@melbpc.org.au>
* treetree.c (objc_is_id): New.
2002-08-16 Tim Josling <tej@melbpc.org.au>
- Remove variables and functions now defined elsewhere.
-
+ Remove variables and functions now defined elsewhere.
+
* treetree.c (maybe_objc_comptypes): Remove.
(warn_format, warn_format_y2k, warn_format_extra_args,
warn_format_nonliteral, warn_format_security,
@@ -33,7 +49,7 @@
2002-07-11 Tim Josling <tej@melbpc.org.au>
- Remove front end hard coding from gengtype.c.
+ Remove front end hard coding from gengtype.c.
* config-lang.in (gtfiles): Add files needed for this front
end.
@@ -41,7 +57,7 @@
2002-07-09 Tim Josling <tej@melbpc.org.au>
Support new attributes regime (Fix for PR c++/7099).
-
+
* treetree.c (handle_format_attribute): Return NULL_TREE instead
of aborting.
(top level): Define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
@@ -60,7 +76,7 @@
2002-06-10 Tim Josling <tej@melbpc.org.au>
- Cleanup
+ Cleanup
* Make-lang.in (check-treelang). Add. Remove direct dependency of
'check' on 'treelang.check' as redundant.
@@ -131,7 +147,7 @@
2002-05-11 Tim Josling <tej@melbpc.org.au>
* treetree.c: (cpp_define) Add.
- (cpp_get_callbacks) Add.
+ (cpp_get_callbacks) Add.
2002-05-07 Tim Josling <tej@melbpc.org.au>
@@ -161,4 +177,4 @@
2001-05-11 Tim Josling <tej@melbpc.org.au>
- Create the new language.
+ Create the new language.
diff --git a/gcc/treelang/Make-lang.in b/gcc/treelang/Make-lang.in
index a1337672872..79da1a6df8f 100644
--- a/gcc/treelang/Make-lang.in
+++ b/gcc/treelang/Make-lang.in
@@ -90,22 +90,20 @@ tree1$(exeext): treelang/tree1.o treelang/treetree.o treelang/lex.o treelang/par
# object file makes
-treelang/tree1.o: $(srcdir)/treelang/tree1.c $(srcdir)/treelang/treelang.h \
- $(srcdir)/treelang/parse.h $(CONFIG_H) \
- gt-treelang-tree1.h gtype-treelang.h
- $(CC) -o $@ -c $(ALL_CFLAGS) $(INCLUDES) $<
-
-treelang/treetree.o: $(srcdir)/treelang/treetree.c $(srcdir)/treelang/treetree.h \
- $(CONFIG_H)
- $(CC) -o $@ -c $(ALL_CFLAGS) $(INCLUDES) $<
-
-treelang/parse.o: $(srcdir)/treelang/parse.c $(srcdir)/treelang/treelang.h \
- $(srcdir)/treelang/treetree.h $(CONFIG_H)
- $(CC) -o $@ -c $(ALL_CFLAGS) $(INCLUDES) $<
-
-treelang/lex.o: $(srcdir)/treelang/lex.c $(srcdir)/treelang/parse.h \
- $(srcdir)/treelang/treelang.h $(CONFIG_H)
- $(CC) -o $@ -c $(ALL_CFLAGS) $(INCLUDES) $<
+treelang/tree1.o: treelang/tree1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ flags.h toplev.h $(GGC_H) $(TREE_H) diagnostic.h treelang/treelang.h \
+ treelang/treetree.h gt-treelang-tree1.h gtype-treelang.h
+
+treelang/treetree.o: treelang/treetree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(TREE_H) flags.h output.h $(C_TREE_H) $(RTL_H) $(GGC_H) toplev.h \
+ varray.h $(LANGHOOKS_DEF_H) langhooks.h treelang/treelang.h \
+ treelang/treetree.h
+
+treelang/parse.o: treelang/parse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) diagnostic.h treelang/treelang.h treelang/treetree.h
+
+treelang/lex.o: treelang/lex.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) diagnostic.h $(TREE_H) treelang/treelang.h treelang/parse.h
# generated files the files from lex and yacc are put into the source
# directory in case someone wants to build but does not have
diff --git a/gcc/treelang/lex.l b/gcc/treelang/lex.l
index b1881dc9f3d..4ce755bff98 100644
--- a/gcc/treelang/lex.l
+++ b/gcc/treelang/lex.l
@@ -1,11 +1,11 @@
-%{ /* -*- c -*- = mode for emacs editor
-/*
+/* -*- c -*- = mode for emacs editor
TREELANG lexical analysis
---------------------------------------------------------------------
- Copyright (C) 1986, 87, 89, 92-96, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1986, 87, 89, 92-96, 1997, 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
@@ -33,16 +33,11 @@
*/
-#include <stdio.h>
-#include <memory.h>
-#include "ansidecl.h"
+%{
#include "config.h"
#include "system.h"
-
-/* Avoid poisoned malloc problem. */
-#undef IN_GCC
-
-#include "config.h"
+#include "coretypes.h"
+#include "tm.h"
#include "diagnostic.h"
#include "tree.h"
diff --git a/gcc/treelang/parse.y b/gcc/treelang/parse.y
index 7d7400f72bb..1f8cf221d61 100644
--- a/gcc/treelang/parse.y
+++ b/gcc/treelang/parse.y
@@ -42,20 +42,10 @@
*/
-/* Undefine IN_GCC so malloc etc work. The alternative is to redefine
- the out of stack routine in bison. */
-#undef IN_GCC
-/* Front ends should not have to see these, but config.h needs everything. */
-typedef void *tree;
-typedef void *rtx;
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "ansidecl.h"
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "diagnostic.h"
#include "treelang.h"
diff --git a/gcc/treelang/tree1.c b/gcc/treelang/tree1.c
index bc54710f15a..1bd46898867 100644
--- a/gcc/treelang/tree1.c
+++ b/gcc/treelang/tree1.c
@@ -33,7 +33,8 @@
#include "config.h"
#include "system.h"
-#include "ansidecl.h"
+#include "coretypes.h"
+#include "tm.h"
#include "flags.h"
#include "toplev.h"
@@ -41,17 +42,11 @@
#include "tree.h"
#include "diagnostic.h"
-#include <stdlib.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <stdarg.h>
-#include <string.h>
-#include <stdio.h>
-
#include "treelang.h"
#include "treetree.h"
extern int yyparse (void);
+
/* Linked list of symbols - all must be unique in treelang. */
static GTY(()) struct prod_token_parm_item *symbol_table = NULL;
diff --git a/gcc/treelang/treetree.c b/gcc/treelang/treetree.c
index 248d4870b31..f489fdf8b1a 100644
--- a/gcc/treelang/treetree.c
+++ b/gcc/treelang/treetree.c
@@ -54,25 +54,12 @@
/* Note it is OK to use GCC extensions such as long long in a compiler front end.
This is because the GCC front ends are built using GCC. */
-/* Standard/OS headers. */
-
-#include <stdlib.h>
-#include <unistd.h>
-#include "safe-ctype.h"
-#include <errno.h>
-#include <stdarg.h>
-#include <limits.h>
-#include <string.h>
-
-#include <fcntl.h>
-#include <getopt.h>
-#include <stdio.h>
-
/* GCC headers. */
#include "config.h"
-#include "ansidecl.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "flags.h"
#include "output.h"
diff --git a/gcc/unroll.c b/gcc/unroll.c
index a357ea209cf..da142a6c86f 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -133,6 +133,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tm_p.h"
#include "insn-config.h"
diff --git a/gcc/unwind-dw2-fde-glibc.c b/gcc/unwind-dw2-fde-glibc.c
index 21b3321ceb6..ba9e3d27d03 100644
--- a/gcc/unwind-dw2-fde-glibc.c
+++ b/gcc/unwind-dw2-fde-glibc.c
@@ -35,12 +35,12 @@
#include "auto-host.h" /* For HAVE_LD_EH_FRAME_HDR. */
#include "tconfig.h"
+#include "tsystem.h"
#ifndef inhibit_libc
-#include <stddef.h>
-#include <stdlib.h>
#include <link.h>
#endif
-#include "tsystem.h"
+#include "coretypes.h"
+#include "tm.h"
#include "dwarf2.h"
#include "unwind.h"
#define NO_BASE_OF_ENCODED_VALUE
diff --git a/gcc/unwind-dw2-fde.c b/gcc/unwind-dw2-fde.c
index f4cb4bb45e9..7f3aeaf3e16 100644
--- a/gcc/unwind-dw2-fde.c
+++ b/gcc/unwind-dw2-fde.c
@@ -31,6 +31,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef _Unwind_Find_FDE
#include "tconfig.h"
#include "tsystem.h"
+#include "coretypes.h"
+#include "tm.h"
#include "dwarf2.h"
#include "unwind.h"
#define NO_BASE_OF_ENCODED_VALUE
diff --git a/gcc/unwind-dw2.c b/gcc/unwind-dw2.c
index 3c5feea4e03..4d127a89763 100644
--- a/gcc/unwind-dw2.c
+++ b/gcc/unwind-dw2.c
@@ -21,6 +21,8 @@
#include "tconfig.h"
#include "tsystem.h"
+#include "coretypes.h"
+#include "tm.h"
#include "dwarf2.h"
#include "unwind.h"
#include "unwind-pe.h"
diff --git a/gcc/unwind-libunwind.c b/gcc/unwind-libunwind.c
new file mode 100644
index 00000000000..e73db1c5697
--- /dev/null
+++ b/gcc/unwind-libunwind.c
@@ -0,0 +1,157 @@
+/* Subroutines needed for unwinding stack frames via the libunwind API.
+ Copyright (C) 2002
+ Free Software Foundation, Inc.
+ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+ 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. */
+
+/* As a special exception, if you link this library with other files,
+ some of which are compiled with GCC, to produce an executable,
+ this library 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 General Public License. */
+
+#include "tconfig.h"
+#include "tsystem.h"
+#include "unwind.h"
+
+#ifndef __USING_SJLJ_EXCEPTIONS__
+
+#define UNW_LOCAL_ONLY
+
+#include <libunwind.h>
+
+typedef struct {
+ _Unwind_Personality_Fn personality;
+} _Unwind_FrameState;
+
+struct _Unwind_Context {
+ unw_cursor_t cursor;
+};
+
+
+/* First come the helper-routines that are needed by unwind.inc. */
+
+static _Unwind_Reason_Code
+uw_frame_state_for (struct _Unwind_Context *context, _Unwind_FrameState *fs)
+{
+ unw_word_t handler;
+
+ if (unw_step (&context->cursor) <= 0)
+ return _URC_END_OF_STACK;
+
+ unw_get_reg (&context->cursor, UNW_REG_HANDLER, &handler);
+ fs->personality = (_Unwind_Personality_Fn) handler;
+
+ return _URC_NO_REASON;
+}
+
+#define uw_update_context(context,fs) do { ; } while (0)
+
+static inline _Unwind_Ptr
+uw_identify_context (struct _Unwind_Context *context)
+{
+ unw_word_t ip;
+ unw_get_reg (&context->cursor, UNW_REG_IP, &ip);
+ return (_Unwind_Ptr) ip;
+}
+
+#define uw_init_context(context) \
+do \
+ { \
+ unw_context_t uc; \
+ unw_getcontext (&uc); \
+ unw_init_local (&(context)->cursor, &uc); \
+ } \
+while (0)
+
+static inline void __attribute__ ((noreturn))
+uw_install_context (struct _Unwind_Context *current __attribute__ ((unused)),
+ struct _Unwind_Context *target)
+{
+ unw_resume (&(target)->cursor);
+ abort ();
+}
+
+
+/* Now come the helper-routines which may be called from an exception
+ handler. The interface for these routines are defined by the C++
+ ABI. See: http://www.codesourcery.com/cxx-abi/abi-eh.html */
+
+_Unwind_Word
+_Unwind_GetGR (struct _Unwind_Context *context, int index)
+{
+ unw_word_t ret;
+
+ /* Note: here we depend on the fact that general registers are
+ expected to start with register number 0! */
+ unw_get_reg (&context->cursor, index, &ret);
+ return ret;
+}
+
+/* Overwrite the saved value for register REG in CONTEXT with VAL. */
+
+void
+_Unwind_SetGR (struct _Unwind_Context *context, int index, _Unwind_Word val)
+{
+ /* Note: here we depend on the fact that general registers are
+ expected to start with register number 0! */
+ unw_set_reg (&context->cursor, index, val);
+}
+
+/* Retrieve the return address for CONTEXT. */
+
+inline _Unwind_Ptr
+_Unwind_GetIP (struct _Unwind_Context *context)
+{
+ unw_word_t ret;
+
+ unw_get_reg (&context->cursor, UNW_REG_IP, &ret);
+ return ret;
+}
+
+/* Overwrite the return address for CONTEXT with VAL. */
+
+inline void
+_Unwind_SetIP (struct _Unwind_Context *context, _Unwind_Ptr val)
+{
+ unw_set_reg (&context->cursor, UNW_REG_IP, val);
+}
+
+void *
+_Unwind_GetLanguageSpecificData (struct _Unwind_Context *context)
+{
+ unw_word_t ret;
+
+ unw_get_reg (&context->cursor, UNW_REG_LSDA, &ret);
+ return (void *) ret;
+}
+
+_Unwind_Ptr
+_Unwind_GetRegionStart (struct _Unwind_Context *context)
+{
+ unw_word_t ret;
+
+ unw_get_reg (&context->cursor, UNW_REG_PROC_START, &ret);
+ return (_Unwind_Ptr) ret;
+}
+
+#include "unwind.inc"
+
+#endif /* !__USING_SJLJ_EXCEPTIONS__ */
diff --git a/gcc/unwind-sjlj.c b/gcc/unwind-sjlj.c
index e1063b4a9c1..535804c1166 100644
--- a/gcc/unwind-sjlj.c
+++ b/gcc/unwind-sjlj.c
@@ -21,6 +21,8 @@
#include "tconfig.h"
#include "tsystem.h"
+#include "coretypes.h"
+#include "tm.h"
#include "unwind.h"
#include "gthr.h"
@@ -92,15 +94,9 @@ static __gthread_key_t fc_key;
static int use_fc_key = -1;
static void
-fc_key_dtor (void *ptr)
-{
- __gthread_key_dtor (fc_key, ptr);
-}
-
-static void
fc_key_init (void)
{
- use_fc_key = __gthread_key_create (&fc_key, fc_key_dtor) == 0;
+ use_fc_key = __gthread_key_create (&fc_key, 0) == 0;
}
static void
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 8b321af8296..43e761274b9 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -29,6 +29,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
@@ -258,16 +260,6 @@ data_section ()
}
}
-/* Tell assembler to ALWAYS switch to data section, in case
- it's not sure where it is. */
-
-void
-force_data_section ()
-{
- in_section = no_section;
- data_section ();
-}
-
/* Tell assembler to switch to read-only data section. This is normally
the text section. */
@@ -961,26 +953,6 @@ make_var_volatile (var)
MEM_VOLATILE_P (DECL_RTL (var)) = 1;
}
-/* Output alignment directive to align for constant expression EXP. */
-
-void
-assemble_constant_align (exp)
- tree exp;
-{
- int align;
-
- /* Align the location counter as required by EXP's data type. */
- align = TYPE_ALIGN (TREE_TYPE (exp));
-#ifdef CONSTANT_ALIGNMENT
- align = CONSTANT_ALIGNMENT (exp, align);
-#endif
-
- if (align > BITS_PER_UNIT)
- {
- ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT));
- }
-}
-
/* Output a string of literal assembler code
for an `asm' keyword used between functions. */
@@ -1848,7 +1820,7 @@ assemble_trampoline_template ()
ASM_OUTPUT_ALIGN (asm_out_file, align);
}
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LTRAMP", 0);
+ (*targetm.asm_out.internal_label) (asm_out_file, "LTRAMP", 0);
TRAMPOLINE_TEMPLATE (asm_out_file);
/* Record the rtl to refer to it. */
@@ -2837,7 +2809,7 @@ output_constant_def_contents (exp, reloc, labelno)
}
/* Output the label itself. */
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LC", labelno);
+ (*targetm.asm_out.internal_label) (asm_out_file, "LC", labelno);
/* Output the value of EXP. */
output_constant (exp,
@@ -3443,7 +3415,7 @@ output_constant_pool (fnname, fndecl)
assemble_align (pool->align);
/* Output the label. */
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LC", pool->labelno);
+ (*targetm.asm_out.internal_label) (asm_out_file, "LC", pool->labelno);
/* Output the value of the constant itself. */
switch (GET_MODE_CLASS (pool->mode))
@@ -4542,7 +4514,9 @@ weak_finish ()
for (t = weak_decls; t; t = TREE_CHAIN (t))
{
tree decl = TREE_VALUE (t);
- const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+#if defined (ASM_WEAKEN_DECL) || defined (ASM_WEAKEN_LABEL)
+ const char *const name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+#endif
if (! TREE_USED (decl))
continue;
@@ -5443,6 +5417,15 @@ default_binds_local_p_1 (exp, shlib)
return local_p;
}
+/* Determine whether or not a pointer mode is valid. Assume defaults
+ of ptr_mode or Pmode - can be overriden. */
+bool
+default_valid_pointer_mode (mode)
+ enum machine_mode mode;
+{
+ return (mode == ptr_mode || mode == Pmode);
+}
+
/* Default function to output code that will globalize a label. A
target must define GLOBAL_ASM_OP or provide it's own function to
globalize a label. */
@@ -5458,4 +5441,18 @@ default_globalize_label (stream, name)
}
#endif /* GLOBAL_ASM_OP */
+/* This is how to output an internal numbered label where PREFIX is
+ the class of label and LABELNO is the number within the class. */
+
+void
+default_internal_label (stream, prefix, labelno)
+ FILE *stream;
+ const char *prefix;
+ unsigned long labelno;
+{
+ char *const buf = alloca (40 + strlen (prefix));
+ ASM_GENERATE_INTERNAL_LABEL (buf, prefix, labelno);
+ ASM_OUTPUT_LABEL (stream, buf);
+}
+
#include "gt-varasm.h"
diff --git a/gcc/varray.c b/gcc/varray.c
index 51e3e8bc142..877c1a396c6 100644
--- a/gcc/varray.c
+++ b/gcc/varray.c
@@ -22,6 +22,8 @@
#include "config.h"
#include "errors.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "varray.h"
#include "ggc.h"
diff --git a/gcc/varray.h b/gcc/varray.h
index 8d4dafb6ca6..a16b98017e1 100644
--- a/gcc/varray.h
+++ b/gcc/varray.h
@@ -28,6 +28,8 @@
#ifndef GCC_SYSTEM_H
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#endif
/* Auxiliary structure used inside the varray structure, used for
diff --git a/gcc/version.c b/gcc/version.c
index 839132210a3..8b6199a575c 100644
--- a/gcc/version.c
+++ b/gcc/version.c
@@ -6,7 +6,7 @@
please modify this string to indicate that, e.g. by putting your
organization's name in parentheses at the end of the string. */
-const char version_string[] = "3.3 20021216 (experimental)";
+const char version_string[] = "3.4 20021216 (experimental)";
/* This is the location of the online document giving instructions for
reporting bugs. If you distribute a modified version of GCC,
diff --git a/gcc/vmsdbgout.c b/gcc/vmsdbgout.c
index 3b8b8f89331..278d16b6458 100644
--- a/gcc/vmsdbgout.c
+++ b/gcc/vmsdbgout.c
@@ -21,9 +21,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#ifdef VMS_DEBUGGING_INFO
-#include "system.h"
#include "tree.h"
#include "flags.h"
#include "rtl.h"
@@ -32,6 +34,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "debug.h"
#include "langhooks.h"
#include "function.h"
+#include "target.h"
/* Difference in seconds between the VMS Epoch and the Unix Epoch */
static const long long vms_epoch_offset = 3506716800ll;
@@ -1361,7 +1364,7 @@ vmsdbgout_begin_block (line, blocknum)
(*dwarf2_debug_hooks.begin_block) (line, blocknum);
if (debug_info_level > DINFO_LEVEL_TERSE)
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, BLOCK_BEGIN_LABEL, blocknum);
+ (*targetm.asm_out.internal_label) (asm_out_file, BLOCK_BEGIN_LABEL, blocknum);
}
/* Output a marker (i.e. a label) for the end of the generated code for a
@@ -1376,7 +1379,7 @@ vmsdbgout_end_block (line, blocknum)
(*dwarf2_debug_hooks.end_block) (line, blocknum);
if (debug_info_level > DINFO_LEVEL_TERSE)
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, BLOCK_END_LABEL, blocknum);
+ (*targetm.asm_out.internal_label) (asm_out_file, BLOCK_END_LABEL, blocknum);
}
/* Not implemented in VMS Debug. */
@@ -1563,7 +1566,7 @@ vmsdbgout_source_line (line, filename)
{
dst_line_info_ref line_info;
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, LINE_CODE_LABEL,
+ (*targetm.asm_out.internal_label) (asm_out_file, LINE_CODE_LABEL,
line_info_table_in_use);
/* Expand the line info table if necessary. */
@@ -1735,7 +1738,7 @@ vmsdbgout_finish (input_filename)
/* Output a terminator label for the .text section. */
text_section ();
- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, TEXT_END_LABEL, 0);
+ (*targetm.asm_out.internal_label) (asm_out_file, TEXT_END_LABEL, 0);
/* Output debugging information.
Warning! Do not change the name of the .vmsdebug section without
diff --git a/gcc/xcoffout.c b/gcc/xcoffout.c
index 528bd7cf6c9..c34096bd382 100644
--- a/gcc/xcoffout.c
+++ b/gcc/xcoffout.c
@@ -26,6 +26,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "flags.h"